Tag name problem


#1

Hi staff,
in my flexy i have a lot of tags named in this mode:
Mytag(0)
Mytag(1)
Mytag(3)

in “Values” page i have no problem, i can see the value of each tag;
in datamailbox i have no problem , i can receive all the values ;

in basic script i have a problem because if i try to use this tag for do something, for example :
print Mytag(0)@
i have this error:
variable not found (16) 4 : Print Mytag(0)@

If i use [ ] instead ( ) the script work fine, but i need to use the ( ) because i’m using ignition and the [ ] are not supported in the tag names.


#2

You can use the GETIO and SETIO commands to work with tags with names like this. To retrieve the value of a tag, you can say:
GETIO “Mytag(0)”

and to set its value, you use something like
SETIO “Mytag(0)”,2


#4

perfect!
thank you Angela