Basic Script Execution Properties

The "Execution" properties are used to configure the parameter which determin how the script is run.

To change the execution properties of a Script, first select it and then use the Movicon "Properties Window" which appears.

 

 

Priority

The basic script resource can run according to which priority they have been given: Above Normal, Normal, and Below normal:

 

Above Normal: Top priority

Normal: Normal Priority

Below Normal: Default value

 

Status Variable

You can assign one of the Movicon  Real Time DB variables to the Basic Script Routine in which the system will write the routine's execution status as status value code in the variable desired.

 

The associated variable can be declared any type (byte, word, etc.). The contents will be:

 

Bit 0 = Basic in run

Bit 1 = Basic in pause

Bit 2 = Basic in error

Bit 3 = Basic buffered

Bit 4 = Execution pending

Bit 5 = Basic in Ideltime

 

The other bits will not be handled and are best left unused for any future handling. Note that only information on the Run status will be provided when the variable is set as Bit type.

 

Maximum Instances

This property allows you to set the highest number of concurrent instances permitted for the Basic Script. This means that the Basic routine can also be called more than once at the same time and created with more instances. However, the final results will differ according to how the "Separate Thread" property is set:

 

Separate Thread Property Enabled: if the script is executed multiple times at the same time, multiple concurrent threads will be created (up to the maximum amount defined in the "Max. Instances' property) and executed at the same time.

Separate Thread Property Disabled: if the script is executed multiple times at the same time, the requests will be buffered and executed immediately after the script has terminated. If the script has not been set in a Separate Thread, only one instance at a time will be run.

 

if a request is made afterwards to execute a script already running with a set maximum number of instances, this request will be denied and notification will be sent to the historical log with this message:

 

"Cannot execute the script 'Basic Script1'. The script is already in execution or the maximum number of instances has been reached"

 

Sleep (ms)

The Sleep time is needed to lighten the workload of the basic script run  on the processor. Longer the sleep times will lessen the basic script's workload by slowing down its execution on the processor.

 

Syncro Timeout  (ms)

Timeout for basic scripts executed in Syncro.  This will be the maximum time to wait before a timeout error is raised during script execution.

 

 If the script resource is executed as a startup basic script, it will always be executed in syncro with the other project resources that are starting up, even though its Separate Thread option has been enabled, by waiting the maximum time equal to the one set in the parameter.

 

 

See Also