Hello Everybody.
I was wondering if it would be possible to construct a Tag’s source path (e.g. an OPC Tag’s path) by using a combination of strings and dynamic Values from other tags.
For instance, I have two UDT instances called Plc, stored in the Device1 and Device2 folder respectively, like so:
MyTags/Devices/Device1/Plc/DeviceName
MyTags/Devices/Device2/Plc/DeviceName
The Plc UDT contains a tag called PlcDeviceName.
Now, each PLC contains a software module called ModuleA, which I model like so:
MyTags/Devices/Device1/Modules/Cooker/Pressure
MyTags/Devices/Device2/Modules/Cooker/Pressure
In both cases, Cooker are instances of a UDT called Cooker, which contains an OPC Tag called Pressure.
What I’m trying to do is to define a dynamic OPC path for Pressure, like so:
[{[.]…/…/Plc/DeviceName}]DB100,I8
which references integer 8 within data block 100 of the underlying SIEMENS PLC (Device1 or Device2 respectively).
I understand the above syntax doesn’t work; I just used it to illustrate my question with an example.
My questions in short:
- Is it possible to define dynamic OPC paths?
- If so, how?
- If not directly possible, can we use some advanced scripting technique to achieve the same results?
Thanks.