Promotic

Run - method of the PmaCommMsg object

Description:
Command for transferring the message (only for messages of the Master type).
Syntax:
Boolean Run([Boolean bPriority])
Parameters:
bPriority[optional] (Boolean) Flag how to fit it in the message queue
false (default) - The object is placed to the end of the queue
true - The object is placed to the beginning of the queue, it means that other waiting messages are skipped
Return value:
true - The message transmission has been initiated successfully, the message has been included into the queue of unfinished transmissions of another PmaCommMsg objects. As the queue passes the message will be transferred and the onEndOfTransfer event is triggered when the transfer is finished.
false - The message transmission has not been initiated. The onEndOfTransfer event is not triggered. The reason can be incorrect message configuration or very commonly the reason is that in the PmaCommMsg object the transmission from previous Run method calling still continues.
Note:
This method is not necessarily called in the script, if the "AutoRun transfer enabled" configurator is checked (if the AutoRunEnabled property is set to true).

The method must be called only for messages of the Master type, for the message of the Slave type it is called automatically (Master/Slave setting - see the "Message type" configurator).
The Run method only activates the message transfer. After termination of the Run method it is never assured that the data have already been transferred. The Run method only causes that the PmaCommMsg object is "placed" into the queue of messages that have to be just transferred.
The PmaCommMsg object waits in the queue until its turn (this functionality is the internal PROMOTIC property and the designer doesn't need to care about it). Then he starts to transmit its data and waits for the requested received data, reads the data and the whole process is finished by triggering of the onEndOfTransfer event. The Run method doesn't wait for these actions any more.
The PmaCommMsg object can find itself in two states - the state when the transmission doesn't proceed and the state when the transmission proceeds (i.e. state between calling the Run method and the onEndOfTransfer event). The Run method can be called only over the object in the state when the transmission in this object doesn't proceed. This state can be found out by the GetReady method.

This method can even be called in the INFO system by clicking the "Actions" button. See "PmaRoot > Permissions > InfoEdit" permission.
See also:
Example:
JavaScriptVBScriptSelect and copy to clipboard

var oCommMsg = pMe.Pm("/Comm/mr");
if (oCommMsg.GetReady())
{
oCommMsg.Run();
}
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.