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.

Hi,

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

-k

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.

Thanks,

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

-k

1 Like

Nice one @keke , works perfectly fine.