Promotic
WikipediaLinkedInYoutubeTwitterFacebook

Add - method of the PmaSequencer object

Description:
Adding new item into the queue.
Syntax:
Boolean Add(Variant Timeout, Variant Val1, [Variant Val2], [Variant Val3], [String Params])
Parameters:
Timeout(Variant) Specifies when the item is released and thus when the onStep event is triggered (if it doesn't occur sooner by the Release method).
If it is the numeric value (of Integer, Long, Single, etc. type), then it means the number of seconds after which to release the item (0=doesn't wait, -1=wait for infinite time). The meaning of this item depends on setting of the "Type of item start" configurator on the "Sequencer" tab:
If set the "0 = items start independently, each according to its timeout", then it is the time from calling the Add method.
If set the "1 = items start chronologically, timeout is delay between them", then it is the time since releasing the last item. In this case the defined timeout must be less or equal to 21 days (i.e. 1814400 seconds).

Possible change of the computer time has no influence to the timeout of items, i.e. the number of seconds is observed till the start.

If it is the value of the Date type, then it is the date and time when to release the item. The Date type cannot be set if set the "1 = items start chronologically, timeout is delay between them". Possible change of the computer time has no influence to the absolute time of starting the items. The items are started in the set absolute time (according to the new time). For example, the item that had to be started in 14:00:00, is started in 14:00:00 of the new time.
Val1(Variant) 1st value of the item. This value can be set for the next usage in the onStep event.
Val2[optional] (Variant) 2nd value of the item. The usage see Val1
Val3[optional] (Variant) 3rd value of the item. The usage see Val1
Params[optional] (String) Additional parameters of the created item. Entries are in KeyVal format, for example thread:main;.
"thread:xxx;" - Specifies the thread where the onStep event is triggered for this item. The setting is relevant only if the PmaSequencer object uses the work thread (see the "Used thread" configurator), otherwise is ignored. The usage of this option see PmaSequencer and How to start selected scripts in another thread.
"thread:work;" (default) - event is triggered in the work thread
"thread:main;" - event is triggered in the main thread
Return values:
true - Item has been added
false - Item hasn't been added. The reason: if the maximum number of items has been exceeded (see MaxSize) or the Timeout parameter is set badly. This is written into the global errors in the INFO system.
See also:
Example1:
Into the object we add an item that is released after 10 seconds:
JavaScriptVBScriptSelect and copy to clipboard

var oSeq = pMe.Pm("/Sequencer");
oSeq.Add(10, "ID1", 1);

History:
Pm9.00.08: The Params method always returned false by mistake in previous PROMOTIC 9.0.X versions.
Pm8.00.03: New Params parameter
PROMOTIC 9.0.13 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice