Dealing With Semicolon Separated Response Data Lists

Dealing With Semicolon Separated Response Data Lists

Last updated: January 16, 2009

Description

In accordance with IEEE 488.2-1992 Section 8.4.1 the test set uses the semicolon (;) as the response message unit separator (RMUS). The RMUS separates sequential response message unit elements from one another when multiple response message unit elements are sent in a response message. This condition would occur when combining multiple queries into a single GPIB transaction.

Query Response Data Types Used By Test Set

The test set can return the following data types in response to queries:

  • character data (char): ASCII characters A-Z (65-90 decimal), underscore (95 decimal), digits (48-57 decimal).

  • string data: ASCII characters enclosed in quotes (for example, "5551212" or "PGSM")

  • numeric response data (nr1): numeric data in the form +/- dddddddd

  • numeric response data (nr3): numeric data in the form +/- ddd.ddd E +/- dddd

Semicolon Separated Response Data Lists Containing Mixed Data Types

Problems can occur when trying to enter semicolon separated response data lists containing mixed data types.

For example: If the following command string is sent to the test set, the test set will respond by constructing a response message which contains multiple response message unit elements (that is, one response message unit element for each query item contained in the command string). Some response message unit elements are string data type, some are character data type and some are nr3 data type.

 
OUTPUT 714;"CALL:MS:REP:IMSI?;PCL?;REV?;SBAN?;ONUM?;MCC?;MNC?;LAC?"

An example response message generated by the test set in response to the above OUTPUT statement would be:

"001012345678901";+4.00000000E+000;PHAS1;"PGSM";"5551212";9.91E37;9.91E37;9.91E37

Constructing the following data entry statement will account for multiple responses from the query:

 
ENTER 714;Imsi$,Pcl,Rev$,Sban$,Onum$,Mcc,Mnc,Lac

In the Basic programming environment the above ENTER statement will fail with an `Insufficient data for ENTER' error. Some programming languages, Basic for example, cannot use the semicolon character as a data item terminator for string variables. In this example Basic will attempt to enter data into Imsi$ until it sees a LF (line feed) data item terminator. The test set does not send the LF until all the data has been sent. Consequently when Basic sees the LF it terminates entry of data into Imsi$ and starts to look for data to enter into Pcl. Since the test set is no longer sending any data the error message `Insufficient data for ENTER' is generated.

One possible workaround is to enter all the data into a single string variable, replace all semicolons with line feeds and then enter the data from the string into the individual data items. For example:

 
DIM Response$[500]
!
!
OUTPUT 714;"CALL:MS:REP:IMSI?;PCL?;REV?;SBAN?;ONUM?;MCC?;MNC?;LAC?"
ENTER 714;Response$
Semicolon=POS(Response$,";")
WHILE Semicolon
Response$[Semicolon,Semicolon]=CHR$(10)
Semicolon=POS(Response$,";")
END WHILE
ENTER Response$;Imsi$,Pcl,Rev$,Sban$,Onum$,Mcc,Mnc,La

Semicolon Separated Response Data Lists Containing Only Numeric Data Types

Semicolon separated response data lists containing only numeric data types do not present the types of problem associated with semicolon separated response data lists containing mixed data types. The number building routines in most languages will use any non-numeric character (that is, anything other than +/- 0123456789 E .) as the data item terminator. Consequently when the number building routines encounter the semicolon the data item is terminated. The following example illustrates this:

 
OUTPUT 714;"FETCH:TXP:INT?;POW:MIN?;MAX?"
ENTER 714;Integrity,Min_power,Max_power