FactoryTalk View SE Display w/ TagParameters & VBA

mgallgood

Member
Join Date
Dec 2016
Location
Tennessee
Posts
19
I'm trying to find the proper way to use the Tag Parameters assigned to a graphic display in FactoryTalk View SE when attempting to access them in VBA code. I am currently have a line of code similar to:
MyString = Me.TagParameters(1)
The tag assigned to the tag parameter is a string type Memory tag.
What I get when I do this is the Tag Name, not the value of the tag.

What am I doing wrong? Any help would be appreciated!

Mike
 
In the configuration for the action of the button that opens the screen I have set the check box for "Tag Parameters" and picked a tag from the Tag Browser. That is the "TagParameter" I am referring to.
 
I really have almost no idea what you are talking about.

In VBA, you read a tags value by making a tag group, adding the tags, activating the group, and then just reading oMyDimmedTag.Value

For the display open command, the "Parameter Tags" are simple substitutions to placeholders on the display. Exactly like using a Parameter file.

If you combine them, and want a parameterized tag value from VBA, you have to first get it's actual tagname, create a tag object, then add it to a tag group, then activate the group, and read its .Value

Welcome to the FTView experience. Everything is made about 20 times harder to do than in any other software out there. And at 20 times the cost.
 
There is a way to get the tag parameters that were passed to a screen in VBA. I've done this. But I'm confused by your question though.
 
I'm trying to find the proper way to use the Tag Parameters assigned to a graphic display in FactoryTalk View SE when attempting to access them in VBA code. I am currently have a line of code similar to:
MyString = Me.TagParameters(1)
The tag assigned to the tag parameter is a string type Memory tag.
What I get when I do this is the Tag Name, not the value of the tag.

What am I doing wrong? Any help would be appreciated!

Mike

Try MyString = Me.TagParameters(1).Value

Can't guarantee it'll work - it's just a semi-educated guess - but everywhere else you use a tag you have to specify that you want the tag value, so I'd imagine you have to specify the same thing here.
 
OK, I was not where I could get screen caps before but I am now.
This is what I am referring to for those who don't know.
TagProperty%20Image.png


I did try the MyString = Me.TagParameters(1).Value statement. This gives me a "VBA Code has been halted. Reason: Compile error - Invalid qualifier" error.

Thanks.
 
FYI.
Well, the image object breaks in the post (at least it does for me).
If I right click the image icon and select open in new tab it displays the image.
 
Some code I did, slightly simplified, under Sub Display_AnimationStart():

Dim ParamList As StringList
Dim TopicName As String
Dim TagName As String
Dim ReqSecurityCode As String

Set ParamList = Me.TagParameters

TopicName = ParamList.Item(1)
TagName = ParamList.Item(2)
ReqSecurityCode = ParamList.Item(3)
 
Thanks John.
That would definitely make the code more readable for me, especially if there were multiple tags being passed to the screen.

In my case, for now, I only need to pass a single parameter in order to allow the logic to decide what tables/values are being queried from the DB (so I can limit the number of screens and amount of logic I have to create.

That said, if anyone has a better idea for doing this than using a Memory Tag to facilitate this functionality I'm all ears! :)

Thanks!
 
Another update.
I did apply the Tag Group concept to my code and it works fine.
I'm starting to get a better and better sense of why so many people here and elsewhere berate this (and other RS) product(s)! WOW.
:|
 

Similar Topics

Hello, I'm using FactoryTalk View ME V10. I created a valve as a global object with multiple parameters and when the object is being used at the...
Replies
2
Views
112
Hello all, I was modifying an HMI in factory talk and went to change a go to display button using the ... to select from a list as I had done...
Replies
3
Views
82
Hi Guys, How can I display Current logged in User Name display on FactoryTalk View studio Site Edition? What I did: String Display object >>...
Replies
3
Views
1,120
Considering the incredible time it would take to get a Panelview Plus 7 , I'm going to get the FactoryTalk View ME Station 30 Display Single...
Replies
1
Views
1,134
Hi everyone, I have to convert keypad HMI to Touch screen but I don't know how to convert my Display List Selector from navigation key to touch...
Replies
12
Views
4,191
Back
Top Bottom