In a nutshell, OmniServer's purpose is to retrieve information from devices that use ‘non-standard’ protocols to communicate such as weight scales, barcode readers, and printers.
Sometimes with some protocols, simply sending one message to a device, or doing nothing but simply transferring data to a client isn't enough. There are some more complex protocols where you will need to send a series of messages to the instrument, or respond to an event coming in from the device or to handle a sequence of handshaking messages. This is where "chained messages" come into play in an OmniServer protocol.
In this second post of a follow-up to our "OmniServer Did You Know?" blog series, we will cover how to chain multiple OmniServer command/request messages together in a protocol to flexibly handle such complex protocols.
With certain device communication protocols, it's not uncommon for devices to require a series of handshaking or initialization procedures to be performed before any meaningful communications can be attempted. An example of such a situation is with modem communications, which requires both an initialization string and a phone number input prior to dialing.
Also, sometimes, a device might require a sequence of commands to be sent in a specific order, with a response in between each command, such as a recipe that needs inputs from the control system in the proper sequence, for example.
Or, perhaps, a device has some number of defined error situations that result in an error message being sent to OmniServer that requires a specific response to proceed with normal communications. Using the "Action" setting in an error message of an OmniServer protocol, combined with the "On Success" and "On Failure" chain settings of command/request messages, OmniServer can act upon that error from the device and take appropriate action (such as sending an acknowledgement or re-sending the original message).
How Can I Do This?
Chained messages can be found in three different sections of an OmniServer protocol:
Are there any limitations to chaining messages?
Not particularly, but it is important to realize that it's possible to create an endless loop if you configure an "On Failure" or "On Success" chain to the same Command/Request message, or to reiterate from early, set an Error Message action to "Retry Forever", when there is no chance that the message will ever succeed - such a loop would require a restart of the OmniServer poller to reset communications.
Do you have a protocol that you’re not really sure how to implement? As always, we're happy to help with a complimentary protocol review of your protocol documentation or to answer questions you may have.
Email us at support@softwaretoolbox.com with your questions and subscribe to our blog for more quick and easy OmniServer tutorials and tips. Then, make sure to download the OmniServer trial to try it yourself for free.