A collection of checksum functions specifically tailored for the labjackusb driver.
More...
|
enum | Model { MODEL_SEARCH = -1,
MODEL_UE9 = 9,
MODEL_U3 = 3,
MODEL_U6 = 6
} |
| The models of LabJack devices. Numbers come from LabJackUD.h. More...
|
|
enum | Connection {
CONNECTION_SEARCH = -1,
CONNECTION_USB = 1,
CONNECTION_ETHERNET = 2,
CONNECTION_ETHERNET_MB = 3,
CONNECTION_ETHERNET_DATA_ONLY = 4
} |
| The connection (i.e., communication media) for LabJacks. Numbers come from LabJackUD.h. More...
|
|
enum | TimerBase {
TIMERBASE_DEFAULT = -1,
TIMERBASE_0 = 0,
TIMERBASE_1 = 1,
TIMERBASE_2 = 2,
TIMERBASE_3 = 3,
TIMERBASE_4 = 4,
TIMERBASE_5 = 5,
TIMERBASE_6 = 6,
TIMERBASE_20 = 20,
TIMERBASE_21 = 21,
TIMERBASE_22 = 22,
TIMERBASE_23 = 23,
TIMERBASE_24 = 24,
TIMERBASE_25 = 25,
TIMERBASE_26 = 26
} |
| The timer base frequencies for LabJacks. More...
|
|
enum | TimerMode {
TIMERMODE_PWM_16BIT = 0,
TIMERMODE_PWM_8BIT = 1,
TIMERMODE_RISING_EDGES_32BIT = 2,
TIMERMODE_FALLING_EDGES_32BIT = 3,
TIMERMODE_DUTY_CYCLE = 4,
TIMERMODE_FIRMWARE_COUNTER = 5,
TIMERMODE_FIRMWARE_COUNTER_DEBOUNCED = 6,
TIMERMODE_FREQUENCY_OUTPUT = 7,
TIMERMODE_QUADRATURE = 8,
TIMERMODE_TIMER_STOP = 9,
TIMERMODE_SYSTEM_TIMER_LOWER_32BITS = 10,
TIMERMODE_SYSTEM_TIMER_UPPR_32BITS = 11,
TIMERMODE_RISING_EDGES_16BIT = 12,
TIMERMODE_FALLING_EDGES_16BIT = 13,
TIMERMODE_LINE_TO_LINE = 14
} |
| The timer modes. More...
|
|
enum | Range {
RANGE_20 = 1,
RANGE_10 = 2,
RANGE_5 = 3,
RANGE_4 = 4,
RANGE_2_POINT_5 = 5,
RANGE_2 = 6,
RANGE_1_POINT_25 = 7,
RANGE_1 = 8,
RANGE_0_POINT_625 = 9,
RANGE_0_POINT_1 = 10,
RANGE_0_POINT_01 = 11
} |
| The analog input ranges. Equivalent to gain. Ignored for Linux scaffold, which auto-ranges. More...
|
|
|
enum | TIMER {
TIMER0,
TIMER1,
TIMER2,
TIMER3,
TIMER4,
TIMER5
} |
|
enum | FIO_LINE {
FIO0,
FIO1,
FIO2,
FIO3,
FIO4,
FIO5,
FIO6,
FIO7
} |
|
enum | EIO_LINE {
EIO0 = 8,
EIO1,
EIO2,
EIO3,
EIO4,
EIO5,
EIO6,
EIO7
} |
|
enum | CIO_LINE { CIO0 = 16,
CIO1,
CIO2,
CIO3
} |
|
enum | MIO_LINE { MIO0 = 20,
MIO1,
MIO2
} |
|
enum | AIN {
AIN0,
AIN1,
AIN2,
AIN3,
AIN4,
AIN5,
AIN6,
AIN7,
AIN8,
AIN9,
AIN10,
AIN11,
AIN12,
AIN13,
AIN14,
AIN15
} |
|
enum | DAC { DAC0,
DAC1
} |
|
|
unsigned char | normalChecksum8 (const std::array< unsigned char, MAXIMUM_BUFFER > &bytes, int count) |
| Calculates an 8-bit 1's complement unsigned checksum specifically for normal command communication with the low-level LabJack driver. More...
|
|
uint16_t | extendedChecksum16 (const std::array< unsigned char, MAXIMUM_BUFFER > &bytes, int count) |
| Calculates a 16-bit 1's complement unsigned checksum specifically for extended command communication with the low-level LabJack driver. More...
|
|
unsigned char | extendedChecksum8 (const std::array< unsigned char, MAXIMUM_BUFFER > &bytes) |
| Calculates an 8-bit 1's complement unsigned checksum specifically for extended command communication with the low-level LabJack driver. More...
|
|
void | normalChecksum (std::array< unsigned char, MAXIMUM_BUFFER > *bytes, int count) |
| Performs the 8-bit 1's complement unsigned checksum required for normal command communication with the low-level LabJack driver, and stores the result in the buffer. More...
|
|
void | extendedChecksum (std::array< unsigned char, MAXIMUM_BUFFER > *bytes, int count) |
| Performs the 1's complement unsigned checksums required for extended command communication with the low-level LabJack driver, and stores the results in the buffer. More...
|
|
double | doubleFromChars (const std::array< unsigned char, MAXIMUM_BUFFER > &bytes, int startIndex) |
| Converts an eight byte array to a floating point double value. More...
|
|
uint32_t | uint32FromChars (const std::array< unsigned char, LabJack::MAXIMUM_BUFFER > &bytes, int startIndex, int count) |
| Converts an array of bytes to a uint32_t, with the least significant byte at startIndex, and the most significant byte at startIndex + byteCount - 1. More...
|
|
uint16_t | uint16FromChars (const std::array< unsigned char, LabJack::MAXIMUM_BUFFER > &bytes, int startIndex, int count) |
| Converts an array of bytes to a uint16_t, with the least significant byte at startIndex. More...
|
|
A collection of checksum functions specifically tailored for the labjackusb driver.
These functions are based off the description in the LabJack User's Guide, and the examples provided with labjackusb.
double SurgSim::Device::LabJack::doubleFromChars |
( |
const std::array< unsigned char, MAXIMUM_BUFFER > & |
bytes, |
|
|
int |
startIndex |
|
) |
| |
Converts an eight byte array to a floating point double value.
This function is necessary for communication with the low-level driver for the LabJack, which passes all data via unsigned char. The expected format is: the first four bytes store the truncated absolute value of the decimal portion times 4294967296, the last four bytes store the signed whole-number portion, and the bytes are stored in little endian order.
- Parameters
-
bytes | The array. |
startIndex | The index of the first element. |
- Returns
- The double.