7.6 Device communication protocols

A device communication protocol encapsulates the recurrent operations to handle things like start and stop characters or checksums with each message to be sent or received. The example below shows the complete message a ND-SatCom upconverter receives to tune its frequency. The pure command is F1435000 (sets the frequency to 14,350.00 MHz). The protocol frame starts with a { followed by the device address. The command is terminated by } and finally a checksum character is sent.

protocol-example.gif

A device communication protocol in the sat-nms software adds the protocol frame data (here marked red) to each message sent by a device driver with a PRINT or WRITE statement. The PRINT or WRITE statement creates the user data, the pure command. The protocol handler looks up the device address in the setup settings for the device, adds the start and stop characters and calculates the checksum over the message. The other way round, for each message received, the protocol handler strips off the protocol frame data and verifies the address and checksum fields. An INPUT or READ statement then receives the pure command data.

With the sat-nms software, new protocol definitions may be added to the software, simply by editing a text file for the new type of protocol frame which is needed.