FTView 32 access UDT using VBA

chopin

Member
Join Date
May 2012
Location
Milton Keynes
Posts
210
Hello,

I have a problem I cannot solve.
How can I access user defined data type tag member using VBA. I have written a short script that allow me to access regular tag so I am able to write and read a value from PLC. I dont know how to do it with UDT member as when I am trying to declare tag object as {Public oTagName.member1 as Tag} VBA does not like it. Any help will be appreciated.

Going step further I also created a global graphic object and it is using UDT as well. Anyone know it is posiible to access a UDT member when using global object??

I am using FTView SE 7.0 and using ControlLogix L73 with Studio5000
 
A really simple way to do this instead of having to declare tag types and go through the 3 step process is this. Otherwise, I've shown how to do it the hard/long way below.

Add a numericdisplay on your screen that points to the tag you want. I open propertyPanel and change the name from NumericDisplay1, or whatever it is, to something like "Tagname" - so it's easier to find.

Right click - expose to VBA.

Now you can reference Tagname.Value and run commands and do whatever you want to that Tag easily.

Alternatively, you can do this. Italicized is stuff you change/enter.

1. Create Tag group

Code:
Set [I]TagGroupName[/I] = Application.CreateTagGroup(Me.AreaName)

2. Add Tags to group, where these are HMI Tags that point to PLC tags. I haven't tried this with direct references - so I can't confirm if that will work or not.
Code:
TagGroupName.Add "[I]HMIFolder\HMITagname[/I]"
Code:
TagGroupName.Add "[I]HMIFolder\HMITagname2[/I]"
Code:
TagGroupName.Add "[I]HMIFolder\HMITagnameN[/I]"

3. Define VBA Tags
Code:
Dim [I]VBATag1[/I] As Tag
Code:
Dim [I]VBATag2[/I] As Tag
Code:
Dim [I]VBATagN[/I] As Tag

4. Map VBA Tags to TagGroupTags (all VBA Tags map to Tags in your TagGroup)
Code:
Set [I]VBATag1[/I] = TagGroupName.Item("HMITagname")
Code:
Set [I]VBATag2[/I] = TagGroupName.Item("HMITagname2")
Code:
Set [I]VBATagN[/I] = TagGroupName.Item("HMITagnameN")

Now you can run functions like:
Code:
VBATag1.Value = "Some String Value"
Or
Code:
VBATag2.Value = "1"

Hope that helps!
 
thanks for your reply. I sort out the problem, I did it very similar way to the one you posted. Difference is I do not have tag databease in SCADA. We keep everything in the PLC.

I also got confirmation from rockwell support that it is not possible to use VBA to access global graphic object. Hope that will help someone in future.
 

Similar Topics

Hi folks. I have a system that I'm working on that needs 2 alarms banners with different event subscription: - One banner for a specific area...
Replies
0
Views
8
Hello guys please I want experience with this I am currently working on a scada project using FTView SE and I have an Ethernet IP local area...
Replies
0
Views
40
I am creating a global object in FTView SE 13. I want to have a string read from the PLC and display (in this case the tagname). So lets say...
Replies
4
Views
192
I want to set user security level based on the value of a tag in my PLC called "ActiveUser". That tag will contain the A-P code which we use for...
Replies
6
Views
240
Hi All, we've recently upgraded from FTView SE v10 to v12. Since the upgrade we've been having a problem where the HMI is slow to update tags in...
Replies
0
Views
102
Back
Top Bottom