84
MPS4264
Appendix
Appendix C - LabVIEW Client Example
Below is an example LabVIEW VI to show how to interface with the MPS 4000 binary server. The frame structure to the left
connects to the MPS4000 binary server with port 503 and prompts the user to enter a file name for the text file that will
hold the scan data in CSV format.
The next frame structure to the right creates a queue and starts the scan by writing a 1 to the binary server. A queue is used
between the producer loop and the consumer loop to handle differences between sampling rates and writing rates.
The next frame structure to the right supports the produce loop and the consumer loop.
The producer loop reads the data from the MPS4000 binary server. The MPS data is formatted such that the VI cast function
can convert it directly to 66 single elements per frame or 264 bytes. This example runs the produce loop at 1ms, but this
could be run at a slower period when the rate of the MPS is slower.
Multiple frames of data from the MPS may be read at once, however this will cause multiple frames of data in one array. For
instance if 4 frames of data are desired with one read, the number of bytes to read is (4 X 264) or 1056 bytes. This allows
the period of the producer loop to be reduced but the spreadsheet will then have 4 frames of data in one row. Additional
LabVIEW functions, or spreadsheet post processing functions, are required to split out each data frame when multiple
frames are read.
In tests with the produce loop set at a period of 1ms, and the read size set equal to 1 frame, data rates to 850 Hz are
possible.
The consumer loop reads data from the queue, displays it to the front panel, converts the data to a string formatted for a
CSV file, and writes the data to a CSV file. When an error is received from the queue, because the queue was closed from the
producer loop, the consumer loop exits and closes the CSV file.
Summary of Contents for MPS4264
Page 1: ...MPS4264 Miniature Pressure Scanner Hardware and Software Manual Software Version 2 07...
Page 2: ......
Page 3: ......
Page 6: ...INTENTIONALLY LEFT BLANK...
Page 12: ...6 MPS4264 Section 1 Specifications INTENTIONALLY LEFT BLANK...
Page 18: ...12 MPS4264 Section 2 Introduction INTENTIONALLY LEFT BLANK...
Page 32: ...26 MPS4264 Section 4 Hardware INTENTIONALLY LEFT BLANK...
Page 38: ...32 MPS4264 Section 5 Software INTENTIONALLY LEFT BLANK...
Page 81: ...75 MPS4264 Section 6 Maintenance INTENTIONALLY LEFT BLANK...
Page 86: ...80 MPS4264 Section 6 Maintenance INTENTIONALLY LEFT BLANK...
Page 87: ...81 MPS4264 Appendix INTENTIONALLY LEFT BLANK...