I’m trying to do it by toggling 4 different bits with “onMouseDown” & “onMouseUp” event scripts.
These are the Tag Paths (Copied & Pasted from each individual tag)
I have tried this: , Adding a separate script for each tag but I keep getting the red squiggly underline and a "no viable alternative at input ‘CCP61’ " message when I hover the cursor over the text.
Your tag adress is a string, so you need to write that line like this:
You can also write all of them at the same time using system.tag.writeAsync()
tagList = ['[default]CCP71/CCP71_stop',
valuesList = [True,True,True,True]
So you can just provide a list of tag paths and values and do it all at once, efficiently.
You can take a better look at how it works here:
I’ve eddited on my response, but since you’re toggling bits, you can’t write
"1" to them, since you’re indicating that that 1 is actually a string, the correct way would be to just use 1 or True
So for now I used a separate script for each tag using system.tag.write(). I couldn’t get system.tag.writeAsync() to work. Thank You
Just so you know,
system.tag.write is now deprecated.
system.tag.writeAsync should be used.
Ps you can simplify this to:
Just fyi this only applies to v8+ and not to v7
which is propably why these new functions aren’t working for the OP
Of course and useful for others to distinguish between, but screenshot is from V8
Haha, that’s embarrassing, I didn’t even look at the screenshot