NI 9144 User Guide and Specifications
42
ni.com
NI 9219 Configuration Commands
There are eight configuration commands for the NI 9219.
Eight configuration commands must be sent for each of the four channels.
This is true even if you are only using a subset of the four channels. Each
of the eight configuration commands is 1 Byte, each configuration
command is followed by a data Byte, and then by a CRC value, which is
1 Byte. Hence, 3 Bytes * 8 Commands * 4 channels = 96 command bytes
(held in 32 entries in the object dictionary).
Data in the object dictionary is held in LSB format, so the value
0x12345678 is represented in memory as the series of bytes 0x78, 0x56,
0x34, 0x12. The command word format is shown in Table 36.
NI 9219 CRC Calculation
U8 crcShiftReg = 0;
for ( x = 0 ; x < 8 ; ++x )
{
dataBool = ((0x80>>x) & configCommand) != 0;
shiftBool = (0x01 & crcShiftReg) != 0;
crcShiftReg /= 2;
if (dataBool != shiftBool)
crcShiftReg ^= 0x8C;
}
for ( x = 0 ; x < 8 ; ++x )
{
dataBool = ((0x80>>x) & configData) != 0;
shiftBool = (0x01 & crcShiftReg) != 0;
crcShiftReg /= 2;
if (dataBool != shiftBool)
crcShiftReg ^= 0x8C;
}
crcShiftReg = crcShiftReg << 1;
return crcShiftReg;
Table 36.
NI 9219 Command Word Format
Bits
Field
31:24
Reserved
23:16
CRC
15:8
Configuration Data
7:0
Configuration Command