All Tutorials / Jlucben / Synbot Plugin Tutorial - interface to Syn Bot Software

Synbot Plugin Tutorial - interface to Syn Bot Software

Step 7 : Accessing in SIML to EZ Builder variables and EZ Builder Command

Invoke the execution of EZB Command In SIML

[x:EZcmd] tag

With [x:EZcmd] tag , you can execute an EZ Builder command

Code:

[x:EZcmd]ControlCommand("Speech Settings", SetVoice, "CereVoice Suzanne - French [France]")[/x:EZcmd]


A sequence of EZB commands can be invoked as in an EZB script.
Each command is separated by the | separator which is interpreted as CR/LF.

Code:

[[x:EZcmd]ControlCommand("Speech Settings", SetVoiceEmphasis, "Reduced")|ControlCommand("Speech Settings", SetVoiceRate, "Medium")[/x:EZcmd]


if the command return a result this result is returned,
for exemple

Code:

 [x:EZcmd]Print(GetVoltage())[/x:EZcmd]

returns the EZB voltage

You can easily with EZcmd tag set value of an EZ Builder Variable.

Code:

[x:EZcmd]$AwaitforSIML = 1[/x:EZcmd]



Access to EZ Builder variables values In SIML

[x:EZvar] tag

With [x:EZvar] tag , you can get the value of an EZ Builder variable or an empty string if the variable does not exist.
Name of EZ builder variable is specified without the first $ character.

Code:

[x:EZvar Get="Direction" /] 


you get the value of the EZ Builder variable $Direction

With [x:EZvar] tag , you can also set the value of an EZ Builder variable - if the variable is not existing , it is created

Code:

[x:EZvar Set="AwaitforSIML" Value="1" /]


You can so synchronize an EZB Builder script with the setting in SIML of a variable.

Code:

[Model]
[Pattern]READY TO GO FORWARD ROBOT[/Pattern]
[Response]
[User Think:Set="Flagforsynchro"]1[/User]
[x:EZvar Set="AwaitforSIML" Value="0" /]
I am waiting for your yes go guy§ControlCommand("Script Manager", ScriptStart, "Synchro forward SIML")§[/Response]
[/Model]
[Model]
[Pattern]YES GO GUY[/Pattern]
[Response]
[If User="Flagforsynchro" Value="1"]
[x:EZvar Set="AwaitforSIML" Value="1" /]
I Will go Forward
[User Think:Set="Flagforsynchro"][/User][/If]
[/Response]
[/Model]


The EZB script Synchro forward SIML is defined as :

Code:

WaitFor($AwaitforSIML = "1")
Forward(140)


User-inserted image
and next :
User-inserted image

SIML User variable Flagforsynchro is used only to be sure than we are awaiting really the YES GO GUY.

Getting or setting of Array EZB Variables is not supported in this plugin version