Basic Script Execution Properties

By using the "Execution" properties you can setup the parameters with which the script will be run.

To change the execution properties of a Script, first select the object with the mouse and then use the Movicon "Properties Window".

 

 

Priority

The execution of a basic script resource can be done with different priorities: 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 as 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 are not handled, and are best left unused for any future handling. Note that only information on the Run status will be supplied 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. The final results will however be different according to how the "Separate Thread" property is set:

 

Separate Thread Property Enabled: if the script is executed many times at the same time, many 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 many times at the same time, the requests will be buffered and executed immediately after the script has stopped being executed. If the script has not been set in a Separate Thread, only one instance at a time can be executed.

 

If afterwards a request is made to execute a script already in execution with a set maximum number of instances, this request will not be granted and notification will be given to 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. The longer the sleep time means lesser the workload from the basic script on the processor by slowing down.

 

Syncro Timeout  (ms)

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

 

 If the script resource is executed as startup basic script, it will get executed in syncro in respect to the other project resources started up as well  (even with Separate Thread active), wating a  maximum time equal to the one set in the parameter.

 

 

See Also