sixcloud
Member
I have spent multiple hours looking for a solution for the following problem.
I have an HMI application that is meant to be installed at 3 separate locations. They are functionally identical and many of the screens (literally 95%) are identical with one exception; OPC tag prefix. Basically, I have an OPC reference structured as follows:
AAAAA.BBBBB.CCCCC.DDDDD
Where AAAAA is the OPC ID. The only thing that is changing from app to app is this prefix. It occurs to me I can supply a parameter when opening a screen by substitution in #1 so the reference looks like this:
#1.BBBBB.CCCCC.DDDDD
Where #1 is the OPC ID. This still creates a situation where I need to have multiple screens or parameters or objects for each app (depending on how I approach it). I would very much like to avoid this as doing it would complicate the project and at some level I'm better off doing a FIND/REPLACE for the prefix and do that instead.
However, what if I could have a HMI Tag that exist that contains a string of the OPC prefix and use the value of that HMI tag to stand in for my OPC prefix?
Let's pretend my ultimate goal is to have OPC references as follows:
NEW_YORK.BBBBB.CCCCC.DDDDD
FLORIDA.BBBBB.CCCCC.DDDDD
IOWA.BBBBB.CCCCC.DDDDD
BBBBB.CCCCC.DDDDD aren't changing in each situation. Only the prefix is.
I have an HMI string tag called OPC_PREFIX that contains one of 3 values:
NEW_YORK
FLORIDA
IOWA
An object on the called display says #1.BBBBB.CCCCC.DDDDD.
If I call the display with:
Display DISPLAY_NAME /PNEW_YORK
This works fine. Likewise when I choose another value, also works fine, obviously.
How about instead using the value at the HMI Tag called OPC_PREFIX? OPC_PREFIX contains one of the appropriate prefixes.
Display DISPLAY_NAME /P{OPC_PREFIX}
I cannot seem to find a combination that works. When I attempt to do some combination of this, it doesn't replace {OPC_PREFIX} with the value of OPC_PREFIX. It errors as:
OPC_PREFIX.BBBBB.CCCCC.DDDDD
Not the VALUE OF OPC_PREFIX, but literally the words OPC_PREFIX.
I have an HMI application that is meant to be installed at 3 separate locations. They are functionally identical and many of the screens (literally 95%) are identical with one exception; OPC tag prefix. Basically, I have an OPC reference structured as follows:
AAAAA.BBBBB.CCCCC.DDDDD
Where AAAAA is the OPC ID. The only thing that is changing from app to app is this prefix. It occurs to me I can supply a parameter when opening a screen by substitution in #1 so the reference looks like this:
#1.BBBBB.CCCCC.DDDDD
Where #1 is the OPC ID. This still creates a situation where I need to have multiple screens or parameters or objects for each app (depending on how I approach it). I would very much like to avoid this as doing it would complicate the project and at some level I'm better off doing a FIND/REPLACE for the prefix and do that instead.
However, what if I could have a HMI Tag that exist that contains a string of the OPC prefix and use the value of that HMI tag to stand in for my OPC prefix?
Let's pretend my ultimate goal is to have OPC references as follows:
NEW_YORK.BBBBB.CCCCC.DDDDD
FLORIDA.BBBBB.CCCCC.DDDDD
IOWA.BBBBB.CCCCC.DDDDD
BBBBB.CCCCC.DDDDD aren't changing in each situation. Only the prefix is.
I have an HMI string tag called OPC_PREFIX that contains one of 3 values:
NEW_YORK
FLORIDA
IOWA
An object on the called display says #1.BBBBB.CCCCC.DDDDD.
If I call the display with:
Display DISPLAY_NAME /PNEW_YORK
This works fine. Likewise when I choose another value, also works fine, obviously.
How about instead using the value at the HMI Tag called OPC_PREFIX? OPC_PREFIX contains one of the appropriate prefixes.
Display DISPLAY_NAME /P{OPC_PREFIX}
I cannot seem to find a combination that works. When I attempt to do some combination of this, it doesn't replace {OPC_PREFIX} with the value of OPC_PREFIX. It errors as:
OPC_PREFIX.BBBBB.CCCCC.DDDDD
Not the VALUE OF OPC_PREFIX, but literally the words OPC_PREFIX.