EasyManua.ls Logo

LabJack UE9 - General Protocol

LabJack UE9
86 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
in the request list.
1006
LJE_NO_MORE_DATA_AVAILABLE
1007
LJE_LABJACK_NOT_FOUND
LabJack not found at the given id or address.
1008
LJE_COMM_FAILURE
Unable to send or receive the correct number
of bytes.
1009
LJE_CHECKSUM_ERROR
1010
LJE_DEVICE_ALREADY_OPEN
1011
LJE_COMM_TIMEOUT
Table 4.4-2. Group Level Error Codes
Table 4-1 lists errors which are specific to a request. For example, LJE_INVALID_CHANNEL_NUMBER. If this error occurs,
other requests are not affected. Table 4-2 lists errors which cause all pending requests for a particular Go() to fail with the same
error. If this type of error is received the state of any of the request is not known. For example, if requests are executed with a
single Go() to set the AIN range and read an AIN, and the read fails with an LJE_COMM_FAILURE, it is not known whether the
AIN range was set to the new value or whether it is still set at the old value.
5 - Low-level Function Reference
This section describes the low-level functions of the UE9. These are commands sent over Ethernet or USB directly to the
processors on the UE9. The Ethernet commands can all be sent using TCP, except for DiscoveryUDP. All commands, except
stream related commands, can also be sent using UDP.
The majority of Windows users will use the high-level UD driver rather than these low-level functions.
5.1 - General Protocol
Following is a description of the general UE9 low-level communication protocol. There are two types of commands:
Normal: 1 command word plus 0-7 data words.
Extended: 3 command words plus 0-125 data words.
Normal commands have a smaller packet size and can be faster in some situations. Extended commands provide more
commands, better error detection, and a larger maximum data payload.
Normal command format:
Byte
0
Checksum8: Includes bytes 1-15
1
Command Byte: DCCCCWWW
Bit 7: Destination Bit:
0 = Local,
1 = Remote.
Bits 6-3: Normal command number (0-14).
Bits 2-0: Number of data words.
2-15
Data words.
Extended command format:
Byte
0
Checksum8: Includes bytes 1-15
1
Command Byte: D1111WWW
Bit 7: Destination Bit:
0 = Local,
1 = Remote.
Bits 6-3: 1111 specifies that this is an extended command
Bits 2-0: Used with some commands.
2
Number of data words.
3
Extended command number.
4
Checksum16 (LSB)
5
Checksum16 (MSB)
6-255
Data words.
Checksum calculations:
All checksums are a1’s complement checksum”. Both the 8-bit and 16-bit checksum are unsigned. Sum all applicable bytes in an
accumulator, 1 at a time. Each time another byte is added, check for overflow (carry bit), and if true add one to the accumulator.
In a high-level language, do the following for the 8-bit normal command checksum:
1. Get the subarray consisting of bytes 1 and up.
2. Convert bytes to U16 and sum into a U16 accumulator.
3. Divide by 2
8
and sum the quotient and remainder.
4. Divide by 2
8
and sum the quotient and remainder.
In a high-level language, do the following for an extended command 16-bit checksum:
52