<< Click to Display Table of Contents >> Navigation: 3. Script Language > IPC, InterKOM and Exit Code > InterKOM Technology |
MiniRobotLanguage (MRL)
IIK.- Conditional Statement
Check if an InterKOM Condition is true
Intention
Conditional statement.
Using IIK. you can check if and InterKOM Condition is true or not. This can be the value of a "Pool Byte" or if a specified Message has arrived.
Using the "Alive" Option, you can also check if other InterKOM Members are alive or not.
InterKOM is like you have a shared pool of variables. As InterKOM is lightning fast, synchronization will easily be possible this way.
For more Informations on InterKOM see here ! Smart Package Robot 's InterKOM Technology.
IIK. is a multi-purpose command that includes multiple possible subcommands.
Usage is simple.
IIK.!Alive|3
DBP. CUN 3 is been shut down.
EIF.
' And technically the same
NIK.Alive|3
DBP. CUN 3 is been shut down.
EIF.
In this more complex example we start a Parallel-Robot to set a Synchronisation Number in the shared Pool. Note that we also use a variable to define the subcommand.
$$SBC=Float
SIK.$$SBC|1|6.5454
$$NUM=6.5453
IIK.$$SBC|1|>$$NUM
DBP. Yes its >$$NUM
ELS.
DBP. No its not >$$NUM
EIF.
$$NUM=12
IIK.$$SBC|1|>$$NUM
DBP. Yes its >$$NUM
ELS.
DBP. No its not >$$NUM
EIF.
ENR.
Syntax
IIK.[!]P1|P2[|P3][|P4]
Parameter Explanation
[!] - If you prefix the Subcommand with a "!" then the Logic is negated and the given
condition is true, if its false and false if its true.
P1 - Subcommand, the following Subcommands are currently supported. Note that for all of the subcommands there is a long form that is better readable, as well as a short form, that can be used to write faster.
• "Byte","B."
IIK.[!]Byte|Nr.|cond/value[|CUN]
• "Long","L."
IIK.[!]Long|Nr.|cond/value[|CUN]
• "Quad","Q."
IIK.[!]Quad|Nr.|cond/value[|CUN]
• "Float","F."
IIK.[!]Float|Nr.|cond/value[|CUN]
• "Use","u."
IIK.[!]Use|CUN
• "Alive","a."
IIK.[!]Alive||CUN
• "Message from","mf."
IIK.Message from|CUN[|$$MSG]
• "Message any","ma."
IIK.Message any|[$$MSG]
Depending on the chosen Subcommand the further Parameters P2 to P4 differ and may be
needed or not.
P2 - Depending on the chosen Subcommand this Parameter may be the number of
the synchronization element or may have another usage.
P3 - (optional) Depending on the chosen Subcommand this Parameter may
be needed or not.
P4 - (optional) Depending on the chosen Subcommand this Parameter may
be needed or not.
Speed in Ticks:
This command uses typically around 550 Ticks for sending a Q-Message.
Example
' This example uses INTERKOM to signal a second Robot to
' end running in a looping.
'
$$SBC=Long
SIK.$$SBC|1|6
$$NUM=4
IIK.$$SBC|1|>$$NUM
DBP. Yes its >$$NUM
ELS.
DBP. No its not >$$NUM
EIF.
$$NUM=12
IIK.$$SBC|1|>$$NUM
DBP. Yes its >$$NUM
ELS.
DBP. No its not >$$NUM
EIF.
ENR.
Remarks
There are multiple examples on InterKOM Commands within the supplied Sample Scripts.
Limitations:
Currently there are limitations to the maximum size that a message may have, using InterKOM. These are 650 kb for this release. This may change in the future.
Also the number of possible InterKOM Clients is limited to 16 at this time.
See also:
• ! Smart Package Robot 's InterKOM Technology