Messages
Messages are mechanism that allows NoSense programs to interact with devices. There are input and output messages. They work in two different ways.
Despite their names, output messages can be used to output information to the devices, as well as to obtain information from them. The important thing is that they are called by the program.
To use an output message:
A1 registerA2 deviceOUT instructionSending output message can change only registers that are mentioned as output parameters for the particular message type.
Input messages are generated by devices and placed in the input message queue. This queue saves order of messages that got in into it. New messages are added to the back and the oldest messages are read and removed from the front of the queue.
You should always keep processing input messages to prevent the situation that queue will become full and messages will be lost. To handle an input message:
WAIT commandIN commandA1 register (0 means that there is
no input message)A2 registerRemember that getting input message can change all the universal registers.