9/30/2013 7:22 PM | |
Posts: 10 Rating: (0) |
Thanks It is really working Next function will create one alarm (event) record if it call in some event (button, I/O Field ect.) ' VBS sub - add user change values to Alarm log
Sub AddtoEventLog(Byval oldval,Byval newVal, Byval tagname) Dim MyAlarm Dim CurrentUserName Dim sCurrentUserName Set CurrentUserName = HMIRuntime.Tags("@local::@CurrentUserName") sCurrentUserName=CurrentUserName.Read(0) Set MyAlarm = HMIRuntime.Alarms(3) MyAlarm.State = 5 MyAlarm.ProcessValues(1) = oldval MyAlarm.ProcessValues(2) = newVal MyAlarm.ProcessValues(3) = sCurrentUserName MyAlarm.ProcessValues(4) = tagname MyAlarm.Create "MyApplication" End Sub One more question, sorry for myeffrontery It is all good working via Process Values Blocks (See attached file event.jpg) but, if I want add some standart Message blocks in alarm (for example "User Name", "Tag", others) – message will not appears (see example for another number of alarms msgblocks.jpg) BR Attachmentexamples.zip (276 Downloads) |
4/25/2018 11:53 AM | |
Joined: 6/19/2017 Last visit: 5/3/2024 Posts: 7987 Rating: (163) |
New question published by pramodva is split to a separate thread with the subject Want to add alarm entries in audit trial. Best regards |
My Forum is the place to personalize your profile, |
|
Follow us on