20
version = version ()
Description:
Get the version information of the EM405-8 Extension Library (this library).
Parameters:
None
Return:
version
String describing the version of the library
usleep ()
Description:
Suspend the thread for the specified number of microseconds. The library
function calls the Linux standard library function usleep(). Actual time slept may
be longer due to system latencies and limitations of the timer resolution of the
hardware.
Parameters:
useconds
Integer number of microseconds to sleep
Return:
None
3.3
PASSING DATA
Data, including commands, can be passed to a script when a script is launched by simply placing
the data in the script arguments. But, what if we want to pass data to a script at some
indeterminate time after launch and what if the script wants to return data? The EM405-8
Extensions Library, discussed in section 3.1, provides both input and output utilities that allow
for data passing between the script and the host computer using the VXI-11 interface. For the
purpose of this discussion, the direction of data is in reference to the script. In other words, input
refers to passing data from host computer to the script and output refers to passing data from the
script to the host computer.
The EM405-8 extensions implement two FIFO’s for data passing, one for each direction. To
place data in the input FIFO, the host computer must send the data preceded by the
*data
command via the VXI-11 interface. The
*data
command is discussed in section 2.1.2. For
example, to pass the string “Hello World” to a script, the host computer can perform a VISA call
as follows:
sprintf(string, “*data Hello World”);
viWrite(vi, strlen(string), string);
The data can be ASCII like the above example or binary like the following example that sends
binary 1, 2, 3, and 4.
sprintf(string, “*data’);
string[5] = 1;
string[6] = 2;
string[7] = 3;
string[8] = 4;
viWrite(vi, 9, string);