Timeout resynchronization
If during packet reception next byte wait time exceeds timeout value, then partially received command is ignored and receive buffer is
cleared. Controller timeout should be less than PC timeout, taking into account time it takes to transmit the data.
Zero byte resynchronization
There are no command codes that start with a zero byte ('\0'). This allows for a following synchronization procedure: controller always
answers with a zero byte if the first command byte is zero, PC ignores first response byte if it is a zero byte. Then, if synchronization is
disrupted on either side the following algorithm is used:
In case PC receives "errc", "errd" or a wrong command answer code, then PC sends 4 to 250 zeroes to the controller (250 byte limit is
caused by input buffer length and usage of I2C protocol, less than 4 zeroes do not guarantee successful resynchronization). During this
time PC continuously reads incoming bytes from the controller until the first zero is received and stops sending and receiving right after
that.
Received zero byte is likely not a part of a response to a previous command because on error PC receives "errc"/"errd" response. It is
possible in rare cases, then synchronization procedure will start again. Therefore first zero byte received by the PC means that
controller input buffer is already empty and will remain so until any command is sent. Right after receiving first zero byte from the
controller PC is ready to transmit next command code. The rest of zero bytes in transit will be ignored because they will be received
before controller response.
This completes the zero byte synchronization procedure.
Library-side error processing
Nearly every library function has a return status of type
result_t
.
After sending command to the controller library reads incoming bytes until a non-zero byte is received. All zero bytes are ignored.
Library reads first 4 bytes and compares them to the command code. It then waits for data section and CRC, if needed. If first 4
received bytes do not match the sent command identifier, then zero byte synchronization procedure is launched, command is
considered to be sent unsuccessfully. If first 4 received bytes match the sent command identifier and command has data section, but
the received CRC doesn't match CRC calculated from the received data, then zero byte synchronization procedure is launched,
command is considered to be sent unsuccessfully. If a timeout is reached while the library is waiting for the controller response, then
zero byte synchronization procedure is launched, command is considered to be sent unsuccessfully.
If no errors were detected, then command is considered to be successfully completed and
result_ok
is returned.
Library return codes
result_ok
. No errors detected.
result_error
. Generic error. Can happen because of hardware problems, empty port buffer, timeout or successfull
synchronization after an error. Another common reason for this error is protocol version mismatch between controller firmware
Page 212 / 345
Page 212 / 345
Summary of Contents for 8SMC5-USB
Page 30: ...Linux Page 30 345 Page 30 345 ...
Page 83: ...Connection of magnetic brake to one axis or two axis systems Page 83 345 Page 83 345 ...
Page 87: ...Scheme of buttons connection to the HDB 26 connector Page 87 345 Page 87 345 ...
Page 99: ...Page 99 345 Page 99 345 ...
Page 167: ...Vertical load capacity the maximum vertical load on the stage Page 167 345 Page 167 345 ...
Page 186: ...Click Next Click Continue anyway Page 186 345 Page 186 345 ...
Page 188: ...Page 188 345 Page 188 345 ...
Page 190: ...Page 190 345 Page 190 345 ...
Page 193: ...Page 193 345 Page 193 345 ...
Page 201: ...Select the XILab application in the Programs block Start it Page 201 345 Page 201 345 ...
Page 274: ...7 Files 1 Configuration files 2 Software Page 274 345 Page 274 345 ...
Page 331: ...Motorized Iris Diaphragms 8MID98 Motorized Iris Diaphragm Page 331 345 Page 331 345 ...
Page 338: ...8 Related products 1 Ethernet adapter Page 338 345 Page 338 345 ...
Page 339: ...8 1 Control via Ethernet 1 Overview 2 Administration Page 339 345 Page 339 345 ...