User Tools

Site Tools


scripting_to_handle_host_messages_in_transsecs_devices

This is an old revision of the document!


Scripting to Handle Host Messages in TransSECS Devices

Receiving the Host Message

Make sure you have keyed your host message on the command name data item in the message definition. The script in the matching host message will be run when the host message is received. If you are having trouble with message matching, read the article on Message Matching.

As a quick test of message matching, enter a script which just prints out a simple message when the message is received, for example:

print("Received Host Message START");

Handling the Message

This example uses the host command “STOP” as a simple example of message handling. The goal is to tell the control application that the STOP has been requested and send an S2F42 reply to the host with a code indicating whether or not the host command is accepted.

print("Received Host Message STOP");
//write a flag to the device so that the control application knows that the STOP was received
/Devices/ModbusTCP_Severs/StopReceived->setIntValue(1);
 
//wait for the control application to reset this flag to "99" or some other agreed upon value

Getting the Command Values from the Message

As an example, the host command PP-SELECT message below has a PPID value and a LOTID vlaue:



scripting_to_handle_host_messages_in_transsecs_devices.1601165631.txt.gz · Last modified: by wikiadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki