Read Variable Function

Owning Palette: Shared Variable Node, VI, and Functions

Requires: Base Development System

Reads from a network-published shared variable, I/O variable, or I/O variable container.

For I/O variables and I/O variable containers, this function performs a scanned read operation.

Details  

 Add to the block diagram  Find on the palette
shared variable refnum in is the reference to the shared variable or I/O variable container. You can right-click this input terminal and select Create»Control or Create»Constant to create this reference. You then can click the control or constant and select Browse to display the Browse Variable Objects dialog box. You also can find variable references programmatically. This input terminal accepts string values too. If you know the exact NI-PSP variable address, you can type the address into a string control and directly wire that string control to this input terminal.
data type specifies the data type of the shared variable or I/O variable container. For I/O variable containers, you must specify an array data type. This input is available only if the data type has not been previously specified. You can specify a data type by placing a checkmark in the Specify Data Type checkbox on the Configuration page of the Properties dialog box for the variable refnum. If you specify the data type upon opening the connection, this terminal is unavailable on subsequent read and write functions.
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
shared variable refnum out is the reference to the shared variable or I/O variable container.
data out is the data read from the shared variable or I/O variable container.
timestamp is the timestamp indicating when the current data was written to the shared variable. This output is available only if you place a checkmark in the Read Timestamp checkbox on the Configuration page of the Properties dialog box for the variable refnum. I/O variable containers do not support timestamps.
error out contains error information. This output provides standard error out functionality.

Read Variable Details

Use this function when you need to read the current value regardless of value changes. If you need to read only new data values, use the Read Variable with Timeout function.

Caution  If you use this function to access a shared variable without first opening a connection to the variable, LabVIEW automatically opens a connection to the variable. However, this implicit open operation can add jitter to the application. Therefore, National Instruments recommends that you open all variable connections with the Open Variable Connection function before accessing the variables.