« Close

Datasheets and User Guides

App Notes

Software & Driver

 

3 - Constants

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 Constants

Used to specify if reading or writing:

READ = 0
WRITE = 1

Used to specify data type for parameters:

UINT16 = 0
UINT32 = 1
INT32 = 2
FLOAT32 = 3

BYTE = 99
STRING = 98
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 = 0
dtUE9 = 9
dtU3 = 3
dtU6 = 6
dtT7 = 7
dtSKYMOTE_BRIDGE = 1000
dtDIGIT = 200

Connection types used to specify connect to be used when opening a device:

ctANY = 0
ctUSB = 1
ctTCP = 2
ctETHERNET = 3
ctWIFI = 4

Constants related to opening devices:

NO_IP_ADDRESS = 0
NO_PORT = 0
DEFAULT_PORT = 502
UNKNOWN_IP_ADDRESS = -1
DEMO_MODE = "-1"
idANY = 0

The size of the arrays of LJM_ListAll:

LIST_ALL_SIZE = 128

Max packet sizes:

MAX_USB_PACKET_NUM_BYTES = 64
MAX_TCP_PACKET_NUM_BYTES_T7 = 1400
MAX_TCP_PACKET_NUM_BYTES_NON_T7 = 64

Timeout constants:

NO_TIMEOUT = 0
DEFAULT_TIMEOUT = 1000

LJM Configuration Constants

The LJM configuration constants configure LJM behavior. For more information, see the Library Configuration Functions.

SEND_RECEIVE_TIMEOUT_MS = "LJM_SEND_RECEIVE_TIMEOUT_MS"

OPEN_TCP_DEVICE_TIMEOUT_MS = "LJM_OPEN_TCP_DEVICE_TIMEOUT_MS"

DEBUG_LOG_MODE = "LJM_DEBUG_LOG_MODE"
	LJM_DEBUG_LOG_MODE_NEVER = 1.0
	LJM_DEBUG_LOG_MODE_CONTINUOUS = 2.0
	LJM_DEBUG_LOG_MODE_ON_ERROR = 3.0

DEBUG_LOG_LEVEL = "LJM_DEBUG_LOG_LEVEL"
	LJM_STREAM_PACKET = 1.0
	LJM_TRACE = 2.0
	LJM_DEBUG = 4.0
	LJM_INFO = 6.0
	LJM_PACKET = 7.0
	LJM_WARNING = 8.0
	LJM_USER = 9.0
	LJM_ERROR = 10.0
	LJM_FATAL = 12.0

DEBUG_LOG_BUFFER_MAX_SIZE = "LJM_DEBUG_LOG_BUFFER_MAX_SIZE"

DEBUG_LOG_SLEEP_TIME_MS = "LJM_DEBUG_LOG_SLEEP_TIME_MS"

LIBRARY_VERSION = "LJM_LIBRARY_VERSION"

ALLOWS_AUTO_MULTIPLE_FEEDBACKS = "LJM_ALLOWS_AUTO_MULTIPLE_FEEDBACKS"

ALLOWS_AUTO_CONDENSE_ADDRESSES = "LJM_ALLOWS_AUTO_CONDENSE_ADDRESSES"

LJM_AUTO_IPS = "LJM_AUTO_IPS"

LJM_AUTO_IPS_FILE = "LJM_AUTO_IPS_FILE"

AUTO_RECONNECT_STICKY_CONNECTION = "LJM_AUTO_RECONNECT_STICKY_CONNECTION"

AUTO_RECONNECT_STICKY_SERIAL = "LJM_AUTO_RECONNECT_STICKY_SERIAL"

MODBUS_MAP_CONSTANTS_FILE = "LJM_MODBUS_MAP_CONSTANTS_FILE"

ERROR_CONSTANTS_FILE = "LJM_ERROR_CONSTANTS_FILE"

DEBUG_LOG_FILE = "LJM_DEBUG_LOG_FILE"

CONSTANTS_FILE = "LJM_CONSTANTS_FILE"

DEBUG_LOG_FILE_MAX_SIZE = "LJM_DEBUG_LOG_FILE_MAX_SIZE"

SPECIFIC_IPS_FILE = "LJM_SPECIFIC_IPS_FILE"

STREAM_AIN_BINARY = "LJM_STREAM_AIN_BINARY"

STREAM_RECEIVE_TIMEOUT_MODE = "LJM_STREAM_RECEIVE_TIMEOUT_MODE"

STREAM_RECEIVE_TIMEOUT_MS = "LJM_STREAM_RECEIVE_TIMEOUT_MS"

STREAM_SCANS_RETURN = "LJM_STREAM_SCANS_RETURN"

STREAM_TRANSFERS_PER_SECOND = "LJM_STREAM_TRANSFERS_PER_SECOND"

RETRY_ON_TRANSACTION_ID_MISMATCH = "LJM_RETRY_ON_TRANSACTION_ID_MISMATCH"

OLD_FIRMWARE_CHECK = "LJM_OLD_FIRMWARE_CHECK"

LJM_USE_TCP_INIT_FOR_T7_WIFI_TCP = "LJM_USE_TCP_INIT_FOR_T7_WIFI_TCP"

LJM_ZERO_LENGTH_ARRAY_MODE = "LJM_ZERO_LENGTH_ARRAY_MODE"