User manual: NI Network Variable device
Status:
17/1-2025: 1.48.871.18: Code updated, new status values, changed used of err message => status message, improved reconnection.
Contents:
Overview:
This device is meant for connection to National Instruments Shared Variables/Network variables. Up to 200 network variables can be connected. The device supports the double, uint16 (WORD) , integer (16 bit), long, DWord and boolean. Each connection can be either read, write or read and write - the state of the connection is controlled by the read and write flags in the ConSys database configuration. It is possible to get the connection status for each network variable - they all have there own status word. When the device is connected the current value is read from the network values - including pure write values.
It is recommended that each ConSys device only access NI shared variables from one NI (RT) source - even though this is not a strict requirement. Avoid using a ConSys network variable device servicing a specific NI network variable-based instrument to for other network variables.
Device parameters:
One-dim address - Address type id 9:
Used for common status and control.
parameter number (a0) |
Suggested SurName |
Description | Data Type | Access Type | Interpretation | Comment |
1 | connect | Connect control | bit | W | Checkbox | Enable/disable connection |
2 | status | Status word | word | R | word displayed as text Id 1896 |
0: Disconnected 1: Disconnect Wait 2: Disconnecting 3: Connect wait 4: Connecting 5: None connected 6: >1 not connected 7: >1 no value 8: All connected |
3 | statusText | Common status string | string | R | string | Show information about connection status, error messages ect. |
4 | refreshConnect | Connection status | bit | W | Control box | Trig a connection refresh. If parameters are connected to different Network variable source a manual refresh will be needed to reconnect to disconnect variables. |
5 | refreshing | Connection status | bit | R | Red/green status bulp | True while refresh connection is taking place. |
Two-dim address - Address type id 10:
Used for individual status on each network variable connection.
a0: Parameter address, 0-199.
parameter type (a1) |
Suggested SirName |
Description | Data Type | Access Type | Interpretation | Comment |
0 | status | Connection status | word | R | Network variable status text | Return the status of the connection as word:
0: network variable not defined |
NI Network varible address - Address type id 50:
Defines the network variables. The datatype of the network variable much macth the datatype of the ConSys parameter defined for a given parameter. The following datatypes are supported:
ConSys datatype id | ConSys datatype | NI Network variable datatype |
0 | ConSysDouble (double) | double |
1 | ConSysWord (WORD) | uint16 |
2 | ConSysBit (BOOL) | boolean |
10 | ConSysDWord (32 bit) | |
11 | ConSysLong (64 bit) | |
14 | ConSysInt16 (16 bit signed) | int16 |
a0: Parameter address, 0-199
a1: Hash key - Used for ConSys device triggering of data servers. It is recommended to defined individual hash keys for read parameters that are updated at high update rates.
s0: National Instruments Network Variable Address.
DataType: As in 'ConSys datatype id' in the table
AccessFilter, use Read and Write Flags:
Read flag set: Make a subscriber connection to the Network variable - every change of the network variable is send to the ConSys device and signalled.
Write flag set: Make a write connection to the Network variable. Values written to the ConSys parameter is written to the network varible.
If both flags is set, a subscriber and a writer connection is made. Remember to set read flag, if updates from other sources should be reflected in ConSys. Avoid setting read flag, if a parameter only is used to write values from ConSys to an NI network variable. For read as well as write parameters, the initial value is read from the network variable when the device connects to the network variables.
Installing required NI libraries
For the ConSys NI network variables device to work NI support libraries for shared variables needs to be installed. The required components for the current version of the shared variable ConSys device can be installed using the install program, install.exe, found in
O:\Nat_ISA-ConSys\ConSysInstall\VC2019\NI\SharedVarCs
This install program will install the following components if not already installed
Last Modified 17 January 2025