Reading HMI Tag using VBA from FctoryTalk SE Tag database

whussain6

Member
Join Date
Oct 2013
Location
Newcastle
Posts
108
Hi,

I am trying to create a list of tags with status, reference and description using Microsoft List view Control 6.0 and VB code behind the scene.

I have successfully created the list as in the attached pic but getting error for first tag when trying to read the tag. All the tags are HMI memory discrete. As you can see from the pic that tag_1(Precheck 1) is healthy but the list shows unhealthy

The error is -2147217536, Unable to read the tag <Tagname>

If I shuffle the tags i.e. read tag_2 first it will error for tag_2

Also I am using for loop to add these tags to the list.

Thanks in advance

Prechecks List.jpg
 
Last edited:
Whole chunk of VBA code

Option Explicit
Public WithEvents objGroup As TagGroup
Private Sub Display_AnimationStart()

Dim objTag As Tag
Dim TagValue As Boolean
On Error GoTo ErrHandler

Set objGroup = Application.CreateTagGroup(Me.AreaName)

objGroup.Add "Test\Tag_1"
objGroup.Add "Test\Tag_2"
objGroup.Add "Test\Tag_3"
objGroup.Add "Test\Tag_4"
objGroup.Add "Test\Tag_5"
objGroup.Active = True


Set objTag = objGroup.Item(Counter)
Let TagValue = objTag.Value

End Sub
 
Last edited:
Solved

I have managed to resolve the issue by chance

all I did is... before reading the value I refreshed the first item of the group i.e.

ObjGroup.item(1).RefreshFromSource
 

Similar Topics

Hello all, I'm working on a project using an AB CompactLogix PLC and 2 Red Lion HMIs (G3) running Crimson 3.0. The PLC and the HMIs are connected...
Replies
4
Views
5,145
Hi guys! I want to read a tag name of hmi tag to create a generic alarm message. Do you know if it's possible to do? I'm using factorytalk view...
Replies
1
Views
714
Hi guys, I have a question regarding studio 5000 with processor 1769-L33ER V33.011 and Factorytalk View SE V12. I have an home-made pop-up...
Replies
3
Views
1,572
Hello, RSLogix 500, a 4-20ma analog input to PLC is scaled for 0 to 100 psi. It is displayed as 0 to 100 psi on HMI, I want to make sure that for...
Replies
14
Views
3,353
I am having an issue with a N7 not getting a correct reading from the PLC to the HMI. When I am online with the PLC i am seeing the correct...
Replies
32
Views
7,588
Back
Top Bottom