Generic Device Driver
Format Instructions for Serial Command Strings

Wherever a command string should be sent or received in the driver definition, enter this string as a valid format instruction. The instruction consists of ASCII characters, special characters, and variable references. However, variable references are allowed only in format instructions that are sent.

ASCII characters are all characters that directly display in the edit field, that is, letters and numbers. All other characters are special characters. To enter special characters, enter \ and two digits with the hexadecimal value of the ASCII table (for example: \0D is <CR> and \0A is <LF>.

Serial control is usually via command strings. In addition to the unique abbreviations that identify the functions, you can also include current parameter values and control characters. Enter the control characters in angle brackets <>, as there are no printable characters to represent them. Control characters define text formatting in lengthy command strings. For controlling serial instruments, they are used to introduce and complete command sequences.

WAVELENGTH=254<CR><LF> is a typical example for a command string that controls the UV wavelength in a detector. In this example, the abbreviation for the required function is WAVELENGTH, the current wavelength value is 254 nm, and the control characters completing the command sequence are <CR><LF>. <CR> represents the Carriage Return control character and <LF> represents Line Feed. In ASCII code, these characters correspond to the decimal values <CR>=0D and <LF>=0A.

Use variable references to include the current value of the property in the format instruction. Observe the following syntax: @[m][.n]f,<name>@ where:

 

d:

Integer variable output as decimal value

u:

Unsigned integer variable output as decimal value

o:

Integer variable output as octal value

x:

Unsigned integer variable output as hexadecimal value with lower case characters

X:

Unsigned integer variable output as hexadecimal value with upper case characters

e:

Floating-point number in exponential format (3.g. 3000 > 3e4)

f:

Floating-point number

g:

Floating-point number in optimum format (for example: 1.5 > 1.5 but 2.0 > 2)

c:

Integer variable output as corresponding ASCII character

 

A simple format instruction with a variable reference for integer variables as the amplification factor can look as follows:

GAIN=@d,Gain@\0D\0A

GAIN= is sent to the instrument as fixed text, followed by the result of the reference variable. @ introduces the variable reference. d means that the current value is returned as an integer decimal value. As no further information about the number of digits is included, their number is determined by the current value. The current value is extracted from the device's Gain property. The command is completed by the two special characters <CR><LF>. For examples for more complex format instructions, refer to the topics below.

For an overview, refer to  The Generic Device Driver.

Defining Standard Property Settings (“Property/Defaults”)

The device driver initializes all properties with invalid values. If it is possible to establish a connection to an instrument, the Connect default field provides two possibilities to re-initialize the properties.