The Option String

In general, the initialization string is an optional list of name-value pairs where the name is the exact string name of of a read/write property of the resource type you are trying to open and the value is a valid value for that property. This allows the option string to set up the properties of a session polymorphically.

Here is an example string from an RS-232 (ASRL) resource:

Timeout = 2000 ; SendEndEnabled = TRUE ; TerminationCharacter = 10 ; TerminationCharacterEnabled = FALSE ; BaudRate = 9600 ; DataBits = 8 ; EndIn = ASRL_END_TERMCHAR ; EndOut = ASRL_END_NONE ; FlowControl = ASRL_FLOW_NONE ; Parity = ASRL_PAR_NONE ; RequestToSendState = 1 ; DataTerminalReadyState = 0 ; StopBits = ASRL_STOP_ONE ; MaximumQueueLength = 1000 ; ReplacementCharacter = 255 ; XONCharacter = 17 ; XOFFCharacter = 19

You may find that the easiest way to get the option string you wish to use in the future is to first create a VISA COM I/O session with a blank option string parameter (meaning the session will be created with the vendor-specific default values.)  Then set the properties on the VISA COM I/O session to the values you desire, and save the value of the OptionString property of the IVisaSession interface to a file to use in future Open calls.

The string must conform to the following grammar:

STRING	[a-zA-Z_][0-9a-zA-Z_]*
NUMBER [0-9]+
 | 0x[0-9a-fA-F]+
;
optionstring: 
 | valuepair
 | valuepair ; optionstring
;
valuepair: propname = initvalue
;
propname: STRING
;
initvalue: STRING
 | NUMBER
 boolean
;
boolean: TRUE
 | FALSE

;


The initvalue type has the following restrictions:

Property Value Type Valid Values

Numeric

Either

  1. A numeric value as defined above.

  2. If there is an enumeration defined the the VISACOM type library for the attribute, the string name of the enumeration value.

String

The string enclosed in quotation marks

Boolean

Either

  1. A numeric value as defined above, with non-zero true and zero defined as false

  2. The strings TRUE or FALSE.