Read/Writing to tag in FTV SE using VBA

Adam83

Member
Join Date
Jun 2007
Location
Perth
Posts
10
Hi

Im currently upgrading a PV1200 project to FTV SE 5.0, and need to know how to read and write directly to tags from VBA.

I can read a tag's value when i link it to a numeric input by using,

NumericInputname.value

but if i want to write to that value i cant do

NumericInputname.value = 1


There has to be a simple way to reference tags etc in vba. like citect for example had the TagRead/TagWrite functions.

is there anything like

TagDatabase.Tag("Tagname").value = 1???


Thanks

Adam
 
I don't know the program that you are using, but i have worked with VBA before.

You need either an activex or a .dll library compatible with VBA to access controller variables.

If the "FTV SE 5.0" program already has a default library for variable linking, look into the object browser in VBA Editor(View->Object Browser) and search for a function like Write or WriteVariable, then just use the function!

Give me more details if you want more help

Matic
 
You need to create a TagGroup. For example:

Set TagGroup = CreateTagGroup(Me.AreaName, 500)
TagGroup.Add "[" & TopicName & "]" & TagName & "_D2SD.ProgOper"

TagGroup.Add "[" & TopicName & "]" & TagName & "_Motor.AlarmMotorFault"

TagGroup.Active = True

TagsOK = TagGroup.RefreshFromSource(TagsInError)

DeviceMode = TagGroup(1).Value
MotorFault = TagGroup(2).Value
 
You need to create a TagGroup. For example:

Set TagGroup = CreateTagGroup(Me.AreaName, 500)
TagGroup.Add "[" & TopicName & "]" & TagName & "_D2SD.ProgOper"

TagGroup.Add "[" & TopicName & "]" & TagName & "_Motor.AlarmMotorFault"

TagGroup.Active = True

TagsOK = TagGroup.RefreshFromSource(TagsInError)

DeviceMode = TagGroup(1).Value
MotorFault = TagGroup(2).Value

Thanks Kerekes,

I have done as you specified and it seems to be working.

Thanks for the help.
 

Similar Topics

Hi, The hardware is: Click Plc model # CO-O1DD1-O HMI model # S3ML-R magnetic-inductive flow meter model # FMM100-1001. I will set the flow meter...
Replies
4
Views
191
Is there a way to use the FAL instruction to do +=2 instead of +=1? I have an array that is organized with alternating "data" and "flag" values...
Replies
5
Views
143
Hi everyone i have a customer, who wants to show an alarm on the machine, if the I/O forces are enabled and set, on at ControlLogix L81E with...
Replies
3
Views
279
Hi Iam using monitouch hmi(V9 soft) with omron plc cj2m (CX programmer). In this I want to read a data from hmi to plc. The data was like...
Replies
0
Views
114
Hi everyone. Quick questions. On UnityPro, I want to open and quickly read tags from a .STA files witouth opening the program. I have 30 plc...
Replies
2
Views
166
Back
Top Bottom