InterKOM Technology

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > IPC, InterKOM and Exit Code >

InterKOM Technology

SIK. - Set InterKOM

Previous Top Next


MiniRobotLanguage (MRL)

 

SIK. Command

Set a IPC-Message or Signal for another Component

 

 

Intention

 

Using SIK. you can send a defined value that can be read by any other InterKOM program, for example using GIK.

 

Its like you have a shared pool of variables. 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.

 

SIK. is a multi-purpose command that includes multiple possible subcommands.

Usage is simple:

 

'Here is an example using SIK. and GIK.

 

' Sent Byte 1 of Robots own "Pool" to 10

SIK.Byte|1|10

 

' Get the actual Value of "own Pool" value Nr.1

GIK.Byte|1||$$RES

 

' Print it

DBP.received: $$RES

 

 

 

Syntax

 

 

SIK.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."

SIK.Byte|Nr.|$$VAL[|CUN]

 

    "Long","L."

SIK.Long|Nr.|$$VAL[|CUN]

 

    "Quad","Q."

SIK.Quad|Nr.|$$VAL[|CUN]

 

    "Float","F."

SIK.Float|Nr.|$$VAL[|CUN]  

 

    "In Use","iu."

SIK.InUse|$$VAL[|CUN]

 

    "Handle","h."

SIK.handle|$$VAL[|CUN]

 

    "Message to","mt."

SIK.Message to|CUN|$$MSG  

Technically a normal Message is a qued message, therefore this command does the same as the following command.

 

    "Qued Message","qms.","q-msg"

SIK.qued Message|CUN|$$MSG

Sends a Message to the Inbox of the receiver CUN. This message will be qued and the Inbox will be free for other Messages from other senders.

 

    "Direct Message","dms."

SIK.direct Message|CUN|$$MSG

A "Direct Message will not be qued, therefore it will block the Inbox of the receiving CUN until it is taken by the receiving CUN, using GIK..  

 

 

 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

 

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

    GIK. - Get InterKOM

    WIK. - Wait InterKOM

    IIK. - If InterCOM Condition