jonsina72
Member
Hi all,
I am a necomer to vba and require a bit of help...
is it possible to modify a tag description in the database for alarm purposes via a runtime display
ie.
tag1 description is "Rig x High High Alarm"
I want them to be able to change the rig number on a display so that any alarm relating to the new number will display correctly.
so if rig number was 2345, tag1 alarm would be "Rig 2345 High High Alarm"
I can almost do it via vb using the following but the project needs restarting for it to take effect:
Public Sub tester()
Dim text1 As Tag
Dim text2 As Tag
Set text1 = gProject.TagDb("test1")
Set text2 = gProject.TagDb("test2")
text1.Description = text2.Value
text1.WriteConfiguration
gTagDb.Synchronize
End Sub
where test1 is a digital tag with alarm
and test2 is a string
the routine is called via a pushbutton where the rig number is typed into test2 and then the pushbutton is pressed to update the description for test1.
any help would be greatly appreciated.
Regards,
Jon
I am a necomer to vba and require a bit of help...
is it possible to modify a tag description in the database for alarm purposes via a runtime display
ie.
tag1 description is "Rig x High High Alarm"
I want them to be able to change the rig number on a display so that any alarm relating to the new number will display correctly.
so if rig number was 2345, tag1 alarm would be "Rig 2345 High High Alarm"
I can almost do it via vb using the following but the project needs restarting for it to take effect:
Public Sub tester()
Dim text1 As Tag
Dim text2 As Tag
Set text1 = gProject.TagDb("test1")
Set text2 = gProject.TagDb("test2")
text1.Description = text2.Value
text1.WriteConfiguration
gTagDb.Synchronize
End Sub
where test1 is a digital tag with alarm
and test2 is a string
the routine is called via a pushbutton where the rig number is typed into test2 and then the pushbutton is pressed to update the description for test1.
any help would be greatly appreciated.
Regards,
Jon