Triggering messages based upon the value of an item
I need to be able to read in an Unsolicited message and then trigger some host messages based upon the value of an item read from the Unsolicited message. Is that possible only using OmniServer? If not, can I use a client program to do this?
That is not possible in the context of an OmniServer only solution.
However, it can be done if you also use a client. Basically, you will need a Host Message for each possible message to be sent to the device based upon the value of your triggering item. For example, suppose you need to send different messages based upon one of four values. You will need four host messages and four "trigger" items.
Here is how you do it:
-
Create your items, including a "trigger" item for each host message you will be creating.
-
Create your unsolicited message.
-
Create all your host messages, one for each possible value of the item. Set the "Trigger" of each host message to the corresponding trigger item.
-
Save the protocol.
The next thing to do is have your client application read in the items in the host message. Once your "trigger" item is received, it will need to determine the value of that item and trigger off the appropriate host message.