beautypg.com

Wsrd (la, buf, count, modevalue, retcount), Wsrdf (la, filename, count, modevalue, retcount), Wsresp (la, response) – National Instruments NI-VXI User Manual

Page 50: Wsrd -12 wsrdf -12 wsresp -12

background image

Chapter 3 Software Overview

NI-VXI User Manual

3-12

© National Instruments Corporation

Normally, you would use the

WSLcmd

function to send Longword

Serial queries with the response automatically read (specified with
respflag). In cases when you need to inspect the Longword Serial
transfer at a lower level, however, you can break up the query sending
and query response retrieval by using the

WSLcmd

function to send the

query as a command, and using the

WSLresp

function to retrieve the

response.

WSLresp

polls the RR bit before reading the response from

the Data High and Data Low registers to form the 32-bit response.
After reading the response, it polls the Response register until the WR
bit is asserted to guarantee that no protocol errors occurred during the
transfer.

WSrd (la, buf, count, modevalue, retcount)

WSrd

is the word serial buffer read function.

WSrd

reads a specified

number of bytes from a Servant device into a local memory buffer,
using the VXIbus Byte Transfer Protocol. The process involves
sending a series of Byte Request (BREQ) Word Serial queries and
reading the responses. Each response contains a data byte in the lower
8 bits and the END bit in bit 8. Before sending the BREQ command,

WSrd

polls both Response register bits—Data Out Ready (DOR) and

Write Ready (WR). It polls the Response register Read Ready (RR) bit
before reading the response from the Data Low register. The read
terminates when it receives a maximum number of bytes or if it
encounters an END bit, a carriage return (CR), a line feed (LF), or a
user-specified termination character.

WSrdf (la, filename, count, modevalue, retcount)

WSrdf

is an extension of the

WSrd

function.

WSrdf

reads a specified

number of bytes from a Servant device into the specified file, using the
VXIbus Byte Transfer Protocol. The process involves calling the
function

WSrd

(possibly many times) to read in a block of data and

writing the data to the specified file. The read terminates when it
receives a maximum number of bytes or if it encounters an END bit, a
carriage return (CR), a line feed (LF), or a user-specified termination
character.

WSresp (la, response)

WSresp

retrieves a response to a previously sent Word Serial Protocol

query from a VXI message-based Servant.

Note:

This function is intended only for debugging purposes.