Share variable between main and sub programs

Hey there experts!

I was wondering if you can share variables between the main and subprograms such as a counter variable cause if I call the variable inside a subprogram I get the following error:
“Error in property ‘Condition’. Property ‘Counter’ in expression ‘Counter==20’ is not found.”
I could define another counter variable inside the subprogram but that would be less eficient and a bit tedious for I have various robots…

Thanks in advance.


Component properties can be used as globals. Creating component properties does require access to modeling so either Professional or Premium product.


Hey @keke , thanks for answering!

But where can I define the variable as global? I’m using the program editor and I don’t see any option to define as global or local to share the variable between sequences.


Component properties are created on the modeling tab like shown on the picture below.


1 Like

Nice one @keke , works perfectly fine.