<< Click to Display Table of Contents >> Navigation: 3. Script Language > IPC, InterKOM and Exit Code > InterKOM Technology |
MiniRobotLanguage (MRL)
GIK. Command
Get a IPC-Message or Signal from another Component
Intention
Using GIK. you can read a number of defined values that can be read or written by any other InterKOM program also. Its like you have a shared pool of variables.
And as InterKOM is lightning fast, synchronization will easily be possible this way.
Using SIK. you can write to this shared memory, and at the same time other processes can read the writings using GIK. or IIK. and react on that.
GIK. is a multi-purpose command that includes multiple possible subcommands.
Usage is simple:
' Get the value of Sync-Byte "1" (lowest) from CUN(-Member) 2
' and place it in Variable $$ERG
GIK.Byte|1|2|$ERG
' Get the value of Sync-Byte "250" from our own Bytes
' and place it on TOS
GIK.Byte|250
' Get the value of Sync-Byte "127" our own Bytes
' and place it in Variable $$ERG
' zero as CUN always evaluates to our own CUN
GIK.Byte|1|0|$ERG
Syntax
GIK.P1|P2[|P3][|P4]
Parameter Explanation
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."
GIK.Byte|(Byte-Nr.)[|(CUN)][|$$ERG]
GIK.Byte|$$BNU|$$CUN|$$RES
• "Long","L."
GIK.Long|(Byte-Nr.)[|(CUN)][|$$ERG]
GIK.Long|$$BNU|$$CUN|$$RES
• "Quad","Q."
GIK.Quad|(Byte-Nr.)[|(CUN)][|$$ERG]
GIK.Quad|$$BNU|$$CUN|$$RES
• "Float","F."
GIK.Float|(Byte-Nr.)[|(CUN)][|$$ERG]
GIK.Float|$$BNU|$$CUN|$$RES
• "Use","U." - "InUse"-Flag from a defined CUN.
If this returns 0 then the CUN with that number is not in use.
GIK.Use|(CUN)[|$$ERG]
• "Message any","ma."
GIK.Message any[|$$ERG]
• "Message from","mf."
GIK.Message from|(Sender-CUN)[|$$ERG]
• "Handle","h."
GIK.Handle|(CUN)[|$$ERG]
• "CUN from Handle","cfh.","cfh"
GIK.cfh|(Handle)[|$$ERG]
• "CUN from PID","cfp.","cfp"
GIK.cfp|(PID)[|$$ERG]
• "CUN from Type","cbt.","cbt"
GIK.cft|(Type)[|$$NUM][|$$ERG]
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.
Example
' This example uses INTERKOM to signal a second Robot to
' end running in a looping.
'
' Run Parallel Robot
PRR.
' Get InterKOM CUN of father-robot
$$CUN=#fcun#
' Here is the Loop
DOL.
GIK.Byte|1|$$CUN|$$RES
PRT.received: $$RES
PAU.0.5
OOP.$$RES=10
MBX.Ending.
ENR.
PRE.
' Here is the Main Robot
PAU.0.2
' Set the Pool-Byte to 10 this will make the Parallel-Robot
' end its loop.
SIK.Byte|1|10
' Receive the byte also
GIK.Byte|1||$$RES
DBP.received: $$RES
MBX.Signal sent.
ENR.
Remarks
-
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
• IIK. - If InterCOM Condition