Go to documentation repository
Previous page Next page
Format of events procedure for the Macro object:
OnEvent("MACRO","_id_","_event_")
Operator format to describe actions with the Macros:
DoReact("MACRO","_id_","_command_" [,"_parameters_"]);
Function to check the state of the Macro object:
CheckState ("MACRO","number","state")
Format of events procedure for the Time zone object:
OnEvent("TIME_ZONE","_id_","_event_")
Operator format to describe actions with the Time zone:
DoReact("MACRO","_id_","_command_" [,"_parameters_"]);
Function to check the state of the Time zone object:
CheckState ("TIME_ZONE","number","state")
Examples of using events and reaction of the Macro object:
Write the current position of camera to preset 1 when running macro 1.
OnEvent("MACRO","1","RUN")
{
DoReact("TELEMETRY","1","SET_PRESET","TEL_PRIOR<1>");
}
Run macro 2 if camera 1 is armed.
OnEvent("CAM","1","ARM")
{
DoReact("MACRO", "2", "RUN");
}
OnEvent("MACRO","1","RUN")
{
DoReact("TELEMETRY","1.1","PATROL_PLAY","tel_prior<1>");
}
OnEvent("MACRO","2","RUN")
{
DoReact("TELEMETRY","1.1","STOP","tel_prior<1>");
}
OnEvent("MACRO","1","RUN") //when running macro 1
{
//square brackets are needed to separate the wait statement into a separate thread
[
flag=1;
for(a=1;flag<2;a=1) //loop statement
{
Sleep(500); //wait statement creates a pause of 500 milliseconds
ff="!!!!!!!!!!!!!!!!!!";
}
]
}
OnEvent("MACRO","2","RUN") //when running macro 2
{
flag=2;
}
Examples of using events and reactions of the Time zone object:
Display video image from the camera 1 on the monitor when activating the first time zone.
OnEvent("TIME_ZONE","1","ACTIVATE")
{
DoReact ("CAM", "1", "ACTIVATE", "MONITOR<1>");
}