LJM Constants
Subsections
A note on language wrapper differences
The constants are accessed in different ways, depending on which LJM language wrapper is being used.
C/C++
LJM constants begin with the prefix LJM_. For example, use LJM_READ.
LabVIEW
LJM constants begin with the prefix LJM_. For example, use LJM_READ.
Python
LJM constants are located in the namespace labjack.ljm.constants and do not begin with the LJM_ prefix. For example:
import labjack print(labjack.ljm.constants.READ) # Prints 0
Or, for a shorter version:
from labjack.ljm import constants as ljmc print(ljmc.READ) # Prints 0
.NET
LJM constants are located in the namespace LabJack.LJM.CONSTANTS and do not begin with the LJM_ prefix. For example:
// C# import LabJack; // ... Console.WriteLine(LJM.CONSTANTS.READ); // Prints 0
' Visual Basic Imports LabJack ' ... Console.WriteLine(LJM.CONSTANTS.READ) ' Prints 0
Delphi
LJM constants begin with the prefix LJM_. For example, use LJM_READ.
Java
LJM constants are located in the namespace com.labjack.LJM.Constants and do not begin with the LJM_ prefix. For example:
import com.labjack.LJM; // ... System.out.println(LJM.Constants.READ); // Prints 0
Node.js
LJM constants are located in ljswitchboard-ljm_driver_constants/lib/driver_constants.js and generally begin with the prefix LJM_. For example,
var ljmc = require('ljswitchboard-ljm_driver_constants'); console.log(ljmc.LJM_READ)
Visual Basic 6 and VBA
LJM constants begin with the prefix LJM_. For example, use LJM_READ.
LJM Configuration Constants
The LJM configuration constants configure LJM behavior, such as timeouts. For more information, see the Library Configuration Functions.
LJM Constants
Used to specify if reading or writing
READ = 0WRITE = 1
Used to specify data type for parameters
UINT16 = 0UINT32 = 1INT32 = 2FLOAT32 = 3BYTE = 99STRING = 98
The STRING data type has the following max size, not including the automatic null-terminator:
STRING_MAX_SIZE = 49
May be used to initialize the ErrorAddress parameter of the multiple value functions:
INVALID_NAME_ADDRESS = -1
The maximum size of the ErrorString of LJM_ErrorToString:
MAX_NAME_SIZE = 256
As an entry of the aData parameter of LJM_eStreamRead, indicates a value was skipped due to auto-recovery:
DUMMY_VALUE = -9999
Device types used to specify which LabJack device to open
dtANY = 0dtUE9 = 9dtU3 = 3dtU6 = 6dtT4 = 4dtT7 = 7dtTSERIES = 84dtSKYMOTE_BRIDGE = 1000dtDIGIT = 200
Common connection types used to specify connect to be used when opening a device
ctANY = 0ctUSB = 1ctTCP = 2 // Ethernet or WiFictETHERNET = 3 // TCPctWIFI = 4 // TCP
Uncommon connection types
ctNETWORK_UDP = 5ctETHERNET_UDP = 6ctWIFI_UDP = 7ctNETWORK_ANY = 8 // TCP or UDPctETHERNET_ANY = 9 // TCP or UDPctWIFI_ANY = 10 // TCP or UDPctANY_UDP = 11 // Available in LJM 1.2100 and later
Constants related to opening devices
NO_IP_ADDRESS = 0NO_PORT = 0TCP_PORT = 502ETHERNET_UDP_PORT = 52362WIFI_UDP_PORT = 502UNKNOWN_IP_ADDRESS = -1
DEMO_MODE = "-2"
idANY = 0
The size of the arrays of LJM_ListAll
LIST_ALL_SIZE = 128
Timeout constants
NO_TIMEOUT = 0DEFAULT_USB_SEND_RECEIVE_TIMEOUT_MS = 2600DEFAULT_ETHERNET_OPEN_TIMEOUT_MS = 1000DEFAULT_ETHERNET_SEND_RECEIVE_TIMEOUT_MS = 2600DEFAULT_WIFI_OPEN_TIMEOUT_MS = 1000DEFAULT_WIFI_SEND_RECEIVE_TIMEOUT_MS = 4000