Dynamically change which PLC an OPC tag is looking at

Consider creating three data types.

One, with incomplete OPC tags--no OPC Item Path--but with all other functionality. (Or perhaps as memory tags.)

A second, that inherits from the above, and overrides all of the (empty) item paths to the Allen Bradley tag paths.

A third, that also inherits from the first, and overrides all of the (empty) item paths to the Modbus addresses.

Instantiate either the second or the third, as appropriate. Perform all other tag-related development in the first.

3 Likes