Therefore it isn't possible, for example, to create infinite loop (e.g. by means of the statements do...while etc.) for testing a variable and to end the loop after the variable gets the required value. This approach with infinite testing is not allowed in the PROMOTIC system!
It also means that, for example, after you start the synchronous Pm.FileCopy method in the script for copying a large file on the network disk, then this method doesn't end (and thus the active script doesn't) until the file has been actually copied! Other scripts don't run for all the time!
One of the basic procedures is to divide the whole procedure into three steps. Read the data from the application, process the data and write the output data into the application (each step is initialised by the onStep event). The read and write step may be assigned to the main thread (preventing the data synchronization problem) and the data processing step can be assigned to the work thread. The assigning of processes to threads can be defined in the Params parameter of the PmaSequencer.Add method. The data read and write then runs in the main thread and data procesing runs in the work thread not delaying the main thread. The processed data must be transmitted between each step. The easiest way of data sharing is to create in the script of the step (the onStep event) a complementary array and transmit it as a Val2 parameter of the PmaSequencer.Add method. It is also possible to transmit the data in the PmaData object. The usage see The example of time consuming process in a work thread.