sixcloud
Member
Hello!
I have review PLCS at least half a dozen times and it occurred to me I might be able to crowd source a solution for something I have been working on.
I am using FactoryTalk View SE 11 taking advantage of KepServer to create an OPC from the controller's Modbus table. One of the items we reuse on the regular is diagnostic pages for displaying information from our controller.
I am attempting to add function to my diagnostic pages to allow the user to highlight any number of tags (up to 16) to send to a trend object. I have successfully added this function using VBA and local HMI memory tags (if interested, pm me and i'll be happy to share).
Ironically I thought the worst was over. I'm trying to now create the "highlight". I want this function to persist between page visits. Allow me to briefly explain a few relevant details.
1. I have 16 HMI memory string tags. Custom_Trend\Trend_Hold_xx.
--These hold the strings I eventually send to the trend object. They
initialize to "empty' and are reset back to "empty" if the user deletes
the tag from the list
2. The memory tag strings are partial KEPServer references. Partial only because the final portions of those HMI tags (the actual tag) is missing. Think "UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1". The complete reference would be like "UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1.VALUE".
3. The diagnostic pages are reused a lot. I would like to limit how much work I do to prep a project. The page is made up using multiple copies of a global object that contain a few common at-a-glance details (TAG, DESCRIPTION, CURRENT VALUE, ENGINEERING UNITS). Also, a checkbox that has VBA which locates empty HMI memory tags and fills the first one it finds with the partial KEPServer reference. This works great.
4. The global object is fed parameters from a parameter file (Display DIAG /P PRAM_FILE_NAME). The global object #1 is tied to #201 in the parameter file. #201 in the parameter file is a partial KepServer reference like UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1
5. Finally, and this is where the issue is, if the partial KEPServer reference exists in one of the memory tags strings, highlight the line item (green rectangle that is visible/invisible).
>>>> The Problem <<<<
If I set up an expression where it attempts to compare the #1 to the {Custom_Trend\Trend_Hold_1}, this fails. #1 in the global object is supplied #201 from the parameter file. #201 in the parameter file is something like UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1. What appears to be occurring is FactoryTalk is treating #1 which is currently holding #201 , which itself is holding UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1 as a substitution and not as a literal string.
I need to compare #1 (which is structured like a KepServer reference) to a HMI memory string tag:
If #1 == {Custom_Trend\Trend_Hold_1} Then 1 Else 0
The produces an error. What resolves is #1 is replaced with #201, and #201 is holding UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1. FactoryTalk attempts to find UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1, which doesn't exist in KepServer. I don't need FactoryTalk to perform the substitution for this comparison, I need it to compare UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1 as a string to Trend_Hold_1.
Any ideas?
I have review PLCS at least half a dozen times and it occurred to me I might be able to crowd source a solution for something I have been working on.
I am using FactoryTalk View SE 11 taking advantage of KepServer to create an OPC from the controller's Modbus table. One of the items we reuse on the regular is diagnostic pages for displaying information from our controller.
I am attempting to add function to my diagnostic pages to allow the user to highlight any number of tags (up to 16) to send to a trend object. I have successfully added this function using VBA and local HMI memory tags (if interested, pm me and i'll be happy to share).
Ironically I thought the worst was over. I'm trying to now create the "highlight". I want this function to persist between page visits. Allow me to briefly explain a few relevant details.
1. I have 16 HMI memory string tags. Custom_Trend\Trend_Hold_xx.
--These hold the strings I eventually send to the trend object. They
initialize to "empty' and are reset back to "empty" if the user deletes
the tag from the list
2. The memory tag strings are partial KEPServer references. Partial only because the final portions of those HMI tags (the actual tag) is missing. Think "UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1". The complete reference would be like "UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1.VALUE".
3. The diagnostic pages are reused a lot. I would like to limit how much work I do to prep a project. The page is made up using multiple copies of a global object that contain a few common at-a-glance details (TAG, DESCRIPTION, CURRENT VALUE, ENGINEERING UNITS). Also, a checkbox that has VBA which locates empty HMI memory tags and fills the first one it finds with the partial KEPServer reference. This works great.
4. The global object is fed parameters from a parameter file (Display DIAG /P PRAM_FILE_NAME). The global object #1 is tied to #201 in the parameter file. #201 in the parameter file is a partial KepServer reference like UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1
5. Finally, and this is where the issue is, if the partial KEPServer reference exists in one of the memory tags strings, highlight the line item (green rectangle that is visible/invisible).
>>>> The Problem <<<<
If I set up an expression where it attempts to compare the #1 to the {Custom_Trend\Trend_Hold_1}, this fails. #1 in the global object is supplied #201 from the parameter file. #201 in the parameter file is something like UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1. What appears to be occurring is FactoryTalk is treating #1 which is currently holding #201 , which itself is holding UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1 as a substitution and not as a literal string.
I need to compare #1 (which is structured like a KepServer reference) to a HMI memory string tag:
If #1 == {Custom_Trend\Trend_Hold_1} Then 1 Else 0
The produces an error. What resolves is #1 is replaced with #201, and #201 is holding UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1. FactoryTalk attempts to find UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1, which doesn't exist in KepServer. I don't need FactoryTalk to perform the substitution for this comparison, I need it to compare UNIT_1.MACHINE_NAME.CONTROLLER.SLOT_1.CH_1 as a string to Trend_Hold_1.
Any ideas?