OPC tag definition

#1

I have ignition setup communicating with rockwell PLC via Rslinx OPC.

in the tag definition, I need to enter the “OPC Server” and “OPC Item Path”.

Currently I need to enter these values either manually or via the parameters in the UDT.

Just wondering whether I can create a new tag folder called “Global” to store the OPC server name and device name. Then I can call these values when defining the OPC tags? So the OPC Item path will become {OPC Server Name}{OPC Device Name}.xxx. These indirect address should be from another tag instead of parameters of the UDT which I am currently using.

So I have a central place to look at or modify if I am switching to another OPC server with a different name later. It will make tag changes much easier.

Thanks in advance.

0 Likes

#2

You didn’t mention what version of Ignition you are using, but UDT’s would fit the bill.

for switching OPC servers, I have successfully used Find/Replace to do this.

0 Likes

#3

@JordanCClark
I have a similar issue that need to change the OPC Server for a lot of tags dynamically during the runtime.

How could I achive it if not using system.tag.confiugre()?

my version is ignition 8.0.4 nightly.

0 Likes

#4

If you’re doing it during runtime, you must use configure.

0 Likes

#5

@JordanCClark

Thanks for your info
The parameters setting is not so convenient as the previous system.tag.editTag.
The first parameter is basePath, not the tag path itself.

0 Likes

#6

You can use the tag path as the basePath.

tagName = '[default]path/to/tag'

tagConfig = system.tag.getConfiguration(tagName)[0]

tagConfig['opcItemPath'] = 'new_opc_item_path'

system.tag.confiure('', [tagConfig])
1 Like

#7

@JordanCClark

Thanks for your suggetsion.
The usage of [0] in system.tag.getConfiguration(tagName) is really useful. :slight_smile:

0 Likes