Error Writing to Tag.value:Bad

From looking around the Forum, it seems that this error means that the tag in the device can not be written.

Which appears to have two causes:

  1. The address doesn't exist (typo or other entry error).
  2. The device is busy doing something else and has refused the write. (Specifically there have been issues seen if this is tried while logic is being updated).

On another note, I'm going to be honest, I didn't think it was possible to have a tag name that began with a number, even if it is, I would strongly suggest that you don't do that, it will eventually bite you.

If you're running this from a Gateway Script, then print doesn't print where you might think.

For what it's worth, I would write your script like this:

path =  ["[default]Ovens/Oven26/DEKEMA_Furnace_Status/OPC_UA_DATA_VisuStatus_Data"]
status = system.tag.readBlocking(path)[0].value
bitFlipper =  ["[default]Ovens/Oven26/IDLE PLC/UnitId 26/26_013-26_013/26_013"]
system.tag.writeBlocking(bitFlipper, [if status == "WAIT"])
2 Likes