MapleMoose
Member
Hello,
I just started learning WinCC V8.0 3 days ago, so I'm still new to how everything works in this program.
I've created a pop-up with a button containing a VB-Action. The Popup is located in a picture window on one of my screens.
However I can't seem to figure out how to configure the action to work with structure tags.
When pressing a start button I want to increase a start counter, but only if the motor is not already running. I currently have this:
If you could suggest how to adjust this for the use of structure tags, or a better way to achieve this I would appreciate it.
I just started learning WinCC V8.0 3 days ago, so I'm still new to how everything works in this program.
I've created a pop-up with a button containing a VB-Action. The Popup is located in a picture window on one of my screens.
However I can't seem to figure out how to configure the action to work with structure tags.
When pressing a start button I want to increase a start counter, but only if the motor is not already running. I currently have this:
Code:
Sub OnLButtonDown(Byval Item, Byval Flags, Byval x, Byval y)
Dim Start
Dim VBVar
Set Start = HMIRuntime.Tags("Pump1.Status")
Set VBVar = HMIRuntime.Tags("Pump1.Starts")
Start.Read
VBVar.Read
If Start.Value = 0 Then
VBVar.Value = VBVar.Value + 1
VBVar.Write
Start.Write(1)
Elseif Start.Value = 1 Then
VBVar.Value = VBVar.Value
VBVar.Write
Start.Write(1)
End If
End Sub
If you could suggest how to adjust this for the use of structure tags, or a better way to achieve this I would appreciate it.