xPC Target    

Shortcuts and Features for Messages

xPC Target defines the abbreviations wrt and rd to make message writing easier with GPIB commands. When the message interpreter sees the statements:

If you enter numerical values in the wrt and rd commands, then the command uses those values instead of the values in the variables ADDR and LENGH. For example, the following message uses the GPIB address 10 even though the value for ADDR is defined as 8.

Changes to the Read Command -- When a GPIB rd command is sent to the GPIB controller, the controller responds with the data and length of data. To make using this command easier, the xPC Target diver block, discards the length of data information. For example, using the normal GPIB rd command, you could write

The code %d reads the length of data and the -1 discards the length. Using the modified xPC Target rd command, you would write

Automatic Addition of Escape Characters -- The message interpreter automatically places the correct escape characters at the end of the message fields .Command, .SendData, and .Ack. However, if you add the escape characters, then the message interpreter does not add additional characters.

The escape characters that are: \\, \a, \b, \f, \r,\t, \v, \', \'', and \n.

For example, you can write

or you can write the following, and the appropriate escape characters are added.


  GPIB Send/Receive Message Structure Supported Data Types for Message Fields