1. Get the subarray consisting of bytes 6 and up.
2. Convert bytes to U16 and sum into a U16 accumulator (can’t overflow).
Then do the following for the 8-bit extended checksum:
1. Get the subarray consisting of bytes 1 through 5.
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.
Destination bit:
This bit specifies whether the command is destined for the local or remote target. Generally, local means the packet should be
handled by the Comm processor, while remote means the Comm processor should pass the packet on.
Multi-byte parameters:
In the following function definitions there are various multi-byte parameters. The least significant byte of the parameter will always
be found at the lowest byte number. For instance, bytes 10 through 13 of CommConfig 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:
Some functions have mask parameters. The WriteMask found in some functions specifies which parameters are to be written. In
the following documentation, parameters affected by the WriteMask have a [#] next to their name which specifies which bit in the
WriteMask goes with which parameter. 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 are updated if a bit 1. If a bit of the
mask is 0 only a read is performed on that bit of I/O.
Resolution:
All analog input functions have a Resolution parameter. This allows you to choose between speed or resolution. See Sections 3.1
and 3.2 for timing information.
SettlingTime:
Some analog input functions have a SettlingTime parameter. This parameter adds extra settling time before each sample of about
SettlingTime * 5 microseconds.
Binary Encoded Parameters:
Many parameters in the following functions use specific bits within a single integer parameter to write/read specific information. In
particular, most digital I/O parameters contain the information for each bit of I/O in one integer, where each bit of I/O corresponds to
the same bit in the parameter (e.g. the direction of FIO0 is set in bit 0 of parameter FIODir). For instance, in the function
ControlConfig, the parameter FIODir is a single byte (8 bits) that writes/reads the direction of each of the 8 FIO lines:
if FIODir is 0, all FIO lines are input,
if FIODir is 1 (2
0
), FIO0 is output, FIO1-FIO7 are input,
if FIODir is 5 (2
0
+ 2
2
), FIO0 and FIO2 are output, all other FIO lines are input,
if FIODir is 255 (2
0
+ … + 2
7
), FIO0-FIO7 are output.
5.2 - Comm Functions
These are functions which are handled by the Comm processor only, and thus the packet destination bit is 0 for local. All functions
can be transferred by USB, Ethernet TCP, or Ethernet UDP.
5.2.1 - CommConfig
Writes and reads various configuration settings associated with the Comm processor.
If WriteMask is nonzero, some or all default values are written to flash. The Comm flash has a rated endurance of at least 20000
writes, which is plenty for reasonable operation, but if this function is called in a high-speed loop with a nonzero WriteMask, the
flash could eventually be damaged.
There is a hardware method to restore parameters to the default values described below (in parentheses). Power up the UE9 with
a short from FIO2<=>SCL, then remove the jumper and power cycle the device again. This also returns Control settings to factory
defaults (Sections 5.3.2 and 5.3.13).