Variable State Saver icon Variable State Saver — Persist and auto-load specified global variables between ARC sessions for consistent, personalized robot behavior and quick state restoration. Try it →

ARC Pro

Upgrade to ARC Pro

Unleash your creativity with the power of easy robot programming using Synthiam ARC Pro

Author Avatar
United Kingdom
LinkedIn Twitter Google+ YouTube
#1  

A little more info is needed really as we have no idea what increases the count. Also, technically a string is alphanumeric not numeric so couldn't be a counter.

But make the script from the following elements...

First define and set the variable

$counter = 0

Have your script do whatever needs doing and when the counter needs increasing by one use

$counter++

So, for instance, if you wanted something to loop 100 times the code would be


$counter = 0

RepeatWhile ($counter < 100)
  Print($counter)
  $counter++
  Sleep(100)
EndRepeatWhile

But if you wanted the counter to count how many times the camera started tracking it would be


$counter = 0

:loop
IF($CameraIsTracking = 1)
  $counter++
EndIf
WaitForChange($CameraIsTracking)
Goto(loop)
#2  

@Rich Thank You for the quick response. What you have provided gave me the answer I was looking for.