Using LabVIEW on a host PC with the NI WSN-3202 with the H908
After creating a new project and adding the WSN gateway and nodes, as outlined in the Getting Started With WSN guide, it is necessary to configure the digital input and output channels. To do this, right click on the WSN-3202 Voltage Node and select Properties. From the Properties window select Discrete Output and select Tristate for DIO1. This configures the DIO1 for digital input and pulls the value up to 5V.
Once the node and gateway are setup, it is a simple matter of acquiring the data, processing the logic and displaying it. In all cases the data is transferred through a shared variable. The shared variable can be dragged and dropped onto the block diagram from the project explorer. In the case of an over-current monitoring application, continuously read in on the DIO1 input channel. The H908 relay will close if the current is greater than the set point. As such, if a digital logic low is read on DIO1 the relay is closed and an over-current situation has occurred.
To implement the previous example, drag and drop a shared variable node for DIO1 onto the host block diagram. Right click on the shared variable and select change to read. Right click on the DIO1 shared variable and select Show Time Stamp. If we don’t want to update the Indicator with repeated data it is important that the timestamp is not equal to the timestamp from the previous iteration. To do this, compare the timestamp from the previous iteration to the shared variable’s timestamp. If they are not the same we update the indicator, if they are the same we do not update the indicator. This is the simplest of cases where all we do is update an indicator on the front panel. It is possible however to have the host VI conduct some more complex operations with this information depending on what is required for your application.
Figure 3. LabVIEW VI Block Diagram Running on Host Computer – Acquires, Scales and Displays Data.
Using LabVIEW WSN Embedded Programs on the NI WSN-3202 with the H908
With LabVIEW WSN, you can download and run LabVIEW VIs on the programmable WSN-3202 node for local data processing and control. In this case it would be possible to do some direct interpretation of the data on the node and then change certain inputs/outputs depending on the state of the DIO1 Channel.