April’s Tip

Home » Blog » Tips » April’s Tip

Handling strings in Simulink

Simulink has not been design to work with strings but there is a lot of situation where strings are useful, particularly within an HLA federation.  The HLA Blockset provides three blocks to handle strings:

  • HLAString:                        Used to create a string
  • HLAStringCompare:     Returns 1 if the values are the same
  • HLAStringDisplay:         Display a string

The later, the HLAStringDisplay is a wonderful debugging tool because it can be used to display all the signal types used by the HLA Blockset (and most of Simulink basic signal type).

For example, you can use it to display the output of an “Automatic Encode” block:

tip1

 

 

 

The federate time:

tip2

 

 

 

 

Display  the ObjectInstanceHandle:

tip3

 

 

 

 

 

 

 

 

 

Or the value of the Marking (RPR-FOM 2):

tip4