Appendix D Data Streaming And Capture - Stanford Research Systems SR865A Operation Manual

4 mhz dsp lock-in amplifier
Table of Contents

Advertisement

Appendix D
Data Streaming and Capture
Example source code for ethernet data streaming (in Python and C++) can be found
under the "Programs" tab of the SR865A product page. The SR865A product page is at
Ethernet streaming of lock-in data (X, Y, R, and θ) is implemented using UDP packets.
The STREAM ON command must be sent via VXI-11 from the computer that will
receive the streamed data. This is because ethernet streaming sends data to the IP address
that sent the STREAM ON command.
UDP packets must be received on a "port," which is a virtual numerical address on the
receiving computer. Common ports, like 80 for web servers or 22 for ssh, should be
avoided. By default, port 1865 is used, but that can be changed with the STREAMPORT
command.
Note: Many computer systems will block SR865A streaming by default. Users will
typically need to open the network port number (1865 by default) to incoming UDP
traffic on their personal firewall software.
All data in the UDP packet are binary, so the "endianness" of the data matters. In big-
endian format, a 32-bit (4-byte) word is stored as B3 B2 B1 B0, where B3 is the most-
significant byte of the word and B0 is the least significant byte. Little-endian format
reverses the byte order, so that the same 32-bit (4-byte) word is stored as B0 B1 B2 B3.
Similarly, a 16-bit (2-byte) integer is stored as B1 B0 in big-endian format, while it is B0
B1 in little-endian format. If the streamed data is not in the same endianness as the
receiving computer, then the byte order of the data must be reversed. Note that the bits
within each byte are NOT reversed.
Each UDP packet sent consists of a 32-bit (4-byte) header, and 128-1024 bytes of data, as
shown below. The endianness of the data and packet integrity-checking are controlled by
the STREAMOPTION command. If integrity-checking is enabled, it is handled
automatically by Ethernet hardware; if an error is detected, then the entire packet is
dropped. The amount of data sent in each packet is controlled by the STREAMPCKT
command. You might want to send fewer data bytes per packet if the sample rate is low
and you want packets to arrive with less latency. Otherwise, larger data sizes are
recommended as they have less overhead and are more bandwidth-efficient.
http://thinkSRS.com/products/SR865A.htm
Data Streaming and Capture
Header
Data
4 bytes
128-1024 bytes
Big-endian
Big- or little-endian
SR865A DSP Lock-in Amplifier
171

Advertisement

Table of Contents
loading

Table of Contents