<< Click to Display Table of Contents >> Navigation: 3. Script Language > Parallel-Robot Operations > Parallel Robot Operations |
MiniRobotLanguage (MRL)
PRS. - Parallel Robot Set Result
Set the Result from a Parallel Running Robot Operation
Intention
Using PRR. and PRE. you can start multiple Robots to do several things at the same time.
It's just like you have a business and several employees working at the same time for you.
Now comes the time that you want to know what they were doing the whole day. You want the "Results". How do they tell you the results of their jobs?
There are two ways, a parallel running robot can send his results to the Main Script.
First can use PRV. to simply change a variable in the Main Script to whatever value you want.
Second you can place a "Result" with your "Ticket Number" in the Main Script, and that is what PRS. is good for.
The system works like this:
1. Start a Parallel Robot using PRR. and PRE. and get a "ticket number"
2. keep the ticket number in a variable
3. do whatever you want ...
4. The Parallel Robot will process its script and get a Result.
5. And call PRS. this will transfer the Result to the Main Script
6. The Mainscript will call WRS. with that "ticket number" as parameter
7. WRS. will wait until the background Operation has finished
8. and then call GRS. to get the result of the Parallel Robot
Hint: If you have just one Parallel-Robot running, you do not need to specify an ticket number. The system always remembers the and uses the ticket number from the last background operation.
Example:
' We start a Parallel Robot
PRR.
' Do any Calculation or whatever here
VAL.$$CAL=9*99
PRS. My Result is $$CAL
ENR.
PRE.
' If we do not specify a ticket number,
' WRS. will automatically remember the last ticket number
' and use it.
WRS.
' If we do not specify a ticket number,
' GRS. will automatically remember the last ticket number
' and use it. Here we get the Result from the Parallel Robot.
GRS.
DBP.$$000
' If we do not specify a ticket number,
' DRS. will automatically remember the last ticket number
' and use it.
' DRS. free's the Memory location that was used to hold the
' Result of the background operation.
DRS.
ENR.
How do i send / collect results from multiple parallel running robots/operations?
Here is an example:
PRR.
GUT.Please give Result for Robot 1
PRS.|Result from Robot 1 is: $$000
ENR.
PRE.
$$ROA=$$001
PRR.
GUT.Please give Result for Robot 2
PRS.|Result from Robot 2 is: $$000
ENR.
PRE.
$$ROB=$$001
STS.DUMP
WRS.$$ROA,$$ROB
GRS.$$ROA
GRS.$$ROB
STS.DUMP
MBX.!
ENR.
You will need to put some text in the two input-boxes, this text is the result from each of the two parallel robot operations.
As you can see, the WRS. will wait until both Results are available. And then present them to you.
Syntax
PRS.[P1][|P2]
Parameter Explanation
P1 - (optional) Variable that contains the own "Ticket-Number". In most cases,
you can omit this parameter, then the own Ticket-Number is used.
P2 - (optional) Variable that contains the Result of the background job, that is to be
sent to the Main Script..
Example
'***********************************
' PRS.-Sample
'***********************************
'
PRR.
GUT.Please give Result for Robot 1
PRS.|Result from Robot 1 is: $$000
ENR.
PRE.
$$ROA=$$001
PRR.
GUT.Please give Result for Robot 2
PRS.|Result from Robot 2 is: $$000
ENR.
PRE.
$$ROB=$$001
STS.DUMP
WRS.$$ROA,$$ROB
GRS.$$ROA
GRS.$$ROB
STS.DUMP
MBX.!
ENR.
Remarks
If you use PRS., always drop the result later in the Main-Script, using DRS..
Otherwise it will be kept in Memory until the Script ends.
Limitations:
There is no technical limit in the size of the result, other then available Memory and System Resources.
See also:
• ! Smart Package Robot 's Parallel Robot Operations