Specifications
Chapter 15 249
Controlling Peripherals
Programming with VISA
1. Chapter Title
2. Chapter Title 3. Chapter Title
4. Chapter Title
15. Controlling Peripherals
STEP 3. Communication
The communication session is conducted in Lines 230 to 280 and Line 410 in Example
15-1. VISA’s viVPrintf function sends a program message (GPIB command) to the
specified instrument. The parameters of this function are connection information (Dcps in
Example 15-1), the program message (a GPIB command in Example 15-1), and the
variable to be formatted (0 in Example 15-1).
NOTE To input/output GPIB commands, the viVPrintf function and the viVScanf function are
mainly used, but other VISA functions are also available. For more information, refer to
visa.hlp (online help for the VISA library).
Syntax viVPrintf(param1,param2,param3)
Parameters
The receiving session is controlled in Lines 310 to 320 in Example 15-1. VISA’s viVScanf
function receives the result from the specified instrument and stores it in the output
variable. The parameters of this function are connection information (Dcps in
Example
15-1), the format parameter for the output variable (%t in Example 15-1), and the output
(param4)
Description Timeout (Enter 0)
(param5)
Description Connection information (output)
Data type Long integer type
(param1)
Description Connection information (input)
Data type Long integer type
(param2)
Description
Program message (input)
*1
Data type Character string type
*1. When sending a program message of the GPIB command, a message terminator is
required at the end of the message (Chr$(10) in
Example 15-1).
(param3)
Description
A variable to be formatted
*1
Data type Specified data type
*1. If not applicable, enter 0.