WSN VIs use Elemental I/O to read from and write to analog and digital channels. You use I/O variables to read data from and write data to the host. To transfer the value of a hardware channel to the host, wire the Elemental I/O item to its corresponding static I/O variable, as shown in the following block diagram.
The following block diagram demonstrates how to use the AI0 I/O variable to write data from AI0 on Node1.
|Note Use the supported Shared Variable functions if the data type of an I/O variable or user-defined I/O variable is a waveform. For I/O variables with other data types, use the static I/O variables for the project.|
You can create user-defined I/O variables to send data from the WSN node to the host. You can create a maximum of eight user-defined I/O variables per WSN node.
Complete the following steps to create a user-defined I/O variable.
|Note Some WSN nodes support only certain types of I/O variables.|
You only can create user-defined I/O variables that send data from the WSN node to the WSN gateway. Sending data from the WSN gateway to the WSN node is unsupported.
The following LabVIEW project includes User0, a user-defined I/O variable.
The following block diagram demonstrates how to write the value of AI0 on Node1 to User0. User0 then sends that data to the WSN gateway.
When you use I/O variables in a WSN VI, LabVIEW buffers the data in the I/O variable buffer, which is a first-in-first-out (FIFO) buffer. Buffering the data prevents data loss if the network connection fails.
You can use the Memory Configuration page to configure the size of the I/O variable buffer. When you increase the I/O variable buffer size, the amount of total RAM that the I/O variable buffer uses might increase significantly. If the network connection fails, the I/O variable buffer retains any data that LabVIEW wrote to the buffer.
You must enable buffering for each I/O variable to enable I/O variable buffering.