Word serial communication, Word serial communication -13 – National Instruments NI-VXI User Manual

Page 32

Advertising
background image

Chapter 2 Introduction to the NI-VXI Functions

© National Instruments Corporation

2-13

NI-VXI User Manual

Word Serial Communication

When communicating with a message-based devices (MBD) in VXI,
the protocol for string passing is known as Word Serial. The term is
derived from the fact that all commands are 16 bits in length (word
length), and that strings are sent serially, or one byte at a time. VXI
also accommodates Long Word Serial (32-bit commands), and
Extended Long Word Serial (48-bit commands). However, the VXIbus
specification revision 1.4 states that only Word Serial commands have
been defined.

Word Serial Protocol is based on a Commander writing 16-bit
commands to a Servant register (See the Commander Word Serial
Protocol Functions
in Chapter 3, Software Overview, for more
information on the protocol). The VXIbus specification has defined
several commands, such as Byte Available, Byte Request, and Clear.
The bit patterns for Word Serial commands have been laid out in the
VXIbus specification, and your application can send these commands
to a Servant via the

WScmd()

function. However, because string

communication is the most common use for Word Serial Protocol, the
functions

WSwrt()

and

WSrd()

use the Word Serial commands Byte

Available (for sending a byte to a servant) and Byte Request (for
retrieving a byte from a Servant) repetitively to send or receive strings
as defined by the Word Serial Protocol. In addition, other common
commands such as Clear have been encapsulated in their own
functions, such as

WSclr()

.

Chapter 3

,

Software Overview

describes all NI-VXI functions

pertaining to message-based communication for the Commander.
However, there are times when you want the controller to operate as a
Word Serial Servant. NI-VXI allows for the controller to accept Word
Serial commands from a Commander. This chapter also

de

scribes a

different set of functions that a Servant uses for message-based
communication with its Commander.

For example,

WSSrd()

(Word Serial Servant Read) sets up the

controller to accept the Byte Request commands from a controller and
respond with the string specified in the function. In a similar fashion,
the

WSSwrt()

function programs the controller to accept Byte

Available commands. National Instruments strongly recommends that
if you want to program the controller as a Servant, you should aim to
become familiar with the Word Serial Protocol in detail, and implement
as much of the protocol as possible to simplify the debugging and
operation of the program.

Advertising