Checksum calculations:
and if true add one to the accumulator.
et the subarray consisting of bytes 1 and up.
into a U16 accumulator.
otient and remainder.
a high-level language, do the following for an extended command 16-bit checksum:
onvert bytes to U16 and sum into a U16 accumulator (can't overflow).
et the subarray consisting of bytes 1 through 5.
onvert bytes to U16 and sum into a U16 accumulator.
quotient and remainder.
-Divide by 2^8 and sum the quotient and remainder.
Destination bit:
All checksums are a "1's complement checksum". Bo
th 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
dded, check for overflow (carry bit),
a
In a high-level language, do the following for the 8-bit normal command checksum:
-G
-Convert bytes to U16 and sum
-Divide by 2^8 and sum the qu
-Divide by 2^8 and sum the quotient and remainder.
In
-Get the subarray consisting of bytes 6 and up.
-C
Then do the following for the 8-bit extended checksum:
-G
-C
-Divide by 2^8 and sum the
This bit specifies whether the command is destined for the local or remote target. This bit is
ignored on the U3.
Multi-byte parameters:
the following function definitions there are various multi-byte parameters. The least
ignificant byte of the parameter will always be found at the lowest byte number. For instance,
Config are the IP address which is 4 bytes long. Byte 10 is the
least significant byte (LSB), and byte 13 is the most significant byte (MSB).
Masks:
In
s
bytes 10 through 13 of Comm
Some functions have mask parameters. The WriteMask found in some functions specifies
which parameters are to be written. If a bit is 1, that parameter will be updated with the new
passed value. If a bit is 0, the parameter is not changed and only a read is performed.
The AINMask found in some functions specifies which analog inputs are acquired. This is a 16-
bit parameter where each bit corresponds to AIN0-AIN15. If a bit is 1, that channel will be
acquired.
The digital I/O masks, such as FIOMask, specify that the passed value for direction and state
re updated if a bit 1. If a bit of the mask is 0 only a read is performed on that bit of I/O.
a
79