Summary: In this exercise, the objective is to graph a waveform that an instrument such as a digital oscilloscope returns as an ASCII or binary string.
CURVE {12,28,63,...128 points in total...,}CR LF
CURVE % {Bin Count MSB}{Bin Count LSB}{åå¤Å...128 bytes in total...} {Checksum} CR LF
![]() Figure 1 |
Waveform Example VI located in the
C:\Exercises\LabVIEW Basics I directory. The
front panel shown in Figure 2 is already
built.
![]() Figure 2 |
![]() Figure 3 |
String Subset
function located on the Functions>>All
Functions>>String palette returns a substring of
128 elements starting from the fifth byte of the binary
waveform string, excluding the header and trailer bytes.
String to Byte Array
function, located on the Functions>>All
Functions>>String>>String/Array/Path Conversion
palette, converts the binary string to an array of
unsigned integers.
String Length
function, located on the Functions>>All
Functions>>String palette, returns the number of
characters in the waveform string.
Extract Numbers VI,
located in the Exercises directory,
extracts numbers from the ASCII waveform string and
places them in an array. Non-numeric characters, such as
commas, separate numbers in the string.
VISA Write and VISA Read
functions, located on the Functions>>All
Functions>>Instrument I/O>>VISA palette, query
the NI Instrument Simulator for a square wave in either
ASCII or 1-byte binary format.
The Simple Error Handler
VI, located on the Functions>>All
Functions>>Time & Dialog palette, reports any
errors.
Data Format to ASCII and run
the VI. The ASCII waveform string displays, the VI converts
the values to a numeric array, and displays the string
length and numeric array.
Data Format to Binary and run
the VI again. The binary waveform string and string length
display, the VI converts the string to a numeric array, and
displays it in the graph.
Comments, questions, feedback, criticisms?
"A full introductory course on programming with LabVIEW."