SensorDAQ User's Manual
13
voltage probe in Ch. 1).
1.
First, resize the While Loop to provide more room for the additional code.
2.
Then add the Index Array function (Find this function by right clicking your
mouse in the block diagram to get your functions palette to appear, then press
the “Search” button at the top of the palette and type in “Index Array”).
a.
Right click on the “Index” node and select Create>Constant. Leave this
input as 0. This code is used to pull out the first value of the array of data
points read from the Voltage Probe in Ch.1. In this example there is only
1 data point in the array, but we still need to use the Index Array function
to pull out that data point. The reason that Ch. 1 data is in an array format
is because in some cases the VI may be set up to read an array of data
points each time the SensorDAQ_Read.vi is called.
3.
Next, find the Greater? function in the block diagram palette and place it in your
While Loop. Wire the Ch. 1 data point into the Greater? function’s top node.
4.
Right click on the bottom node of the Greater? Function and select
Create>Control.
a.
Label this control as “threshold”.
b.
Go to the Front panel to find the threshold control
The comparison code above will tell us if the analog output voltage is greater than
the threshold value. If it is, turn on an LED by turning on the digital output line of
the screw terminal; if it is not, turn off the LED. This same type of code is performed
in ControlEx01_ControlDigOutWithSensor.vi. Copy and paste this code into the VI.