Message-Based Communication

Whether you are using RS-232, GPIB, Ethernet, VXI, or USB, message-based communication is a standard protocol for controlling and receiving data from instruments. Because most message-based devices have similar capabilities, it is natural that the driver interface should be consistent. Under VISA, controlling message-based devices is the same regardless of what hardware interface(s) those devices support or how those devices are connected to your computer.

VISA message-based communication includes the Basic I/O Services and the Formatted I/O Services from within the VISA Instrument Control Resource (INSTR). All sessions to a VISA Instrument Control Resource (INSTR) opened using viOpen() have full message-based communication capabilities. Of course, if the device is a register-based VXI device, the message-based operations return an error code (VI_ERROR_NSUP_OPER) to indicate that this device does not support the operations, although the session still provides access to them. This help file discusses the uses of the Basic I/O Services and the Formatted I/O Services provided by the INSTR Resource in a VISA application.

The following topics show how to use the VISA library in message-based communication.

Basic I/O Services

Synchronous Read/Write Services

Asynchronous Read/Write Services

Clear Service

Trigger Service

Status/Service Request Service

Example VISA Message-Based Application

Formatted I/O Services

Formatted I/O Operations

I/O Buffer Operations

Variable List Operations

Manually Flushing the Formatted I/O Buffers

Automatically Flushing the Formatted I/O Buffers

Resizing the Formatted I/O Buffers

Formatted I/O Read and Low-Level I/O Receive Buffers

Formatted I/O Write and Low-Level I/O Transmit Buffers

Recommendations for Using the VISA Buffers

Formatted I/O Instrument Driver Examples

Integers

Floating Point Values

Strings

Data Blocks