FactoryTalk Parameter Tag Comparison as Literal String

sixcloud

Member
Join Date
Jan 2020
Location
Houston, TX
Posts
3
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?
 
Hi sixcloud

a very interesting stuff you are doing there.
One question first: how are you making "local HMI memory tags"?
Do you create tags through vba in tag folders?

To your problem.
Dont you think it would make more sense to perform comparision in vba? The parameter files and parameter tags are so limited and basic in FTV. With vba you manage a lot easyer the indirect references, and parsing of the (tag) strings.
Just for your info, its also possible to access vba functions on another display, for example to set or read a vba variable on another display.

Best regards
Dorian Hildebrandt
 
Last edited:

Similar Topics

I have a screen that can be opened by 4 different buttons. Each button loads a different parameter file for that screen. I am passing a constant...
Replies
3
Views
2,201
Hello everybody. I have a question on using tag parameters that are sent to a display. Factory talk's documentation is awful and it seems like...
Replies
5
Views
3,607
Hi Everyone, I am trying to add a constant value (such as a string) into the parameter file. I put the string in " " but it does not work. would...
Replies
2
Views
163
Hi All, I'm currently designing a faceplate for an analog input object, and I'm trying to create an alarm tab with an Alarm and Event Summary...
Replies
1
Views
405
Back
Top Bottom