SPLat Logo

Error handling in SPx communications instructions

NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

Error handling in SPx communications instructions

There are two possible error conditions resulting from an SPx communications instruction: Missing SPx peripheral and invalid command sent to a SPx peripheral. Both are fatal errors.

If the addressed SPx peripheral is not present there will no response to messages. The SPLat processor will make 10 tries on a message before giving up. It will then execute a run time error restart, recording error type (Missing SPx peripheral) and program address.

There is one exception, which is the "Are You There" message (SPxCmd0 with cc=127). If this fails to get a response after 10 tries, the SPLat processor will set U(0) to False and then continue. This provides a mechanism for your program to determine the presence of possibly optional SPx peripherals.

If the addressed SPx peripheral is present but is sent a command that is not valid for it, or which it cannot currently execute (the peripheral might be busy or in the wrong state) it will send back a NACK (Negative ACKnowledge). This will be a result of a SPLatWare programming error. The SPLat processor will make 10 tries on a message before giving up. It will then execute a run time error restart, recording the error type (Invalid command to SPx peripheral) and program address.