EasyManua.ls Logo

Copper Mountain Technologies S2 Series - Receiving Data Arrays in Text Form; Receiving Data Arrays in Binary Form

Copper Mountain Technologies S2 Series
428 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
S2VNA and S4VNA SCPI Programming Manual
412
5.5 Receiving Data Arrays in Text Form
By default the data from the analyzer is transmitted in a text form. The VISA
library has built-in facilities for receiving an array of data from the analyzer. The
example assumes that the size of the array is sufficient to receive a number of
elements equal to twice the number of points.
An example of receiving a data array in C/C++:
5.6 Receiving Data Arrays in Binary Form
The transfer of data from the analyzer in binary form reduces the amount of data
transferred and the transmission time. The transfer of binary data is supported
only by the HiSLIP protocol. To enable binary data transfer, use the FORM: DATA
command. The list of commands that support the transfer of binary data is given
in the description of the FORM: DATA command.
Binary data is transmitted as a block having a header followed by data. Block
format:
Where:
# the character '#';
8 the character '8';
<Data Size> 8 bytes, the symbolic representation of the number of bytes of
binary data.
For example:
#800003216<Binary Data>
The VISA library has built-in tools for receiving binary data from the analyzer. The
example assumes that the size of the array is sufficient to receive a number of
elements equal to twice the number of points.
Example of receiving binary data array in C/C ++:
double DataArray[1000];
ViUInt32 retCount;
...
retCount = sizeof(DataArray) / sizeof(double);
viQueryf(instr, "CALC:DATA:SDAT?\n", "%,#lf", &retCount, Data);
// retCount now contains the actual number of elements read
#
8
<Data Size>
<Binary Data>

Table of Contents