WinCC Dynamic VBS Question

wolfboy84

Member
Join Date
Nov 2012
Location
Missouri
Posts
1
Hello all,

I'm having a problem that i could use some advice on. I have a combo box and a static text box that has dynamic text based off an integer down in the AS. What i want to have happen is that every time the selection of the combo box changes that a new value of the selected index is pushed into this integer so that the text changes to a verbose description I have the code under my miscellaneous event Change. Please see the code attached below

Dim VarButton
Dim OPERATIONLOG
Dim TAGNAME
Dim INDEX
Dim RSB_FLAG
Dim DFE_FLAG
Dim UNE_FLAG
Dim READY
Dim MachineStateTemp
Dim test_text

Set RSB_FLAG = HMIRuntime.Tags("AS1/DFE_UNE_RSB.RSB_Flag")

RSB_FLAG.Value = 1
RSB_FLAG.Read
RSB_FLAG.Write

Do



' Set MachineStateTemp = HMIRuntime.Tags("AS1/MachineStateTemp")
'MachineStateTemp.Read

'test_text.text = "i'm here"

Set VarButton = HMIRuntime.Tags("AS1/MachineStateTemp")

Set INDEX = HMIRuntime.Tags("AS1/DFE_UNE_RSB.DFE_LIST_INDEX")
INDEX.read
VarButton.Value=300+INDEX.Value
VarButton.Write

'MachineStateTemp.Value = VarButton.Value
'MachineStateTemp.Write

Set TAGNAME = ScreenItems("TAGNAME")
TAGNAME.Text = "MachineStateTemp"
Set OPERATIONLOG = ScreenItems("OPERATIONLOG")
OPERATIONLOG.Text = " Change Machine State to "&VarButton.Value
Set "AS1/DFE_UNE_RSB.DFE_Flag" = False

Set DFE_FLAG = HMIRuntime.Tags("AS1/DFE_UNE_RSB.DFE_Flag")
Set UNE_FLAG = HMIRuntime.Tags("AS1/DFE_UNE_RSB.UNE_Flag")
Set READY_FLAG = HMIRuntime.Tags("AS1/DFE_UNE_RSB.READY_Flag")

DFE_FLAG.Read
UNE_FLAG.Read
READY_FLAG.Read

If(DFE_FLAG.Value = 1 Or UNE_FLAG.Value = 1 Or READY_FLAG.Value = 1) Then
RSB_FLAG.Value = 0
RSB_FLAG.Write
End If

'RSB_FLAG.Value = 0
'RSB_FLAG.Write
Loop While(RSB_Flag.Value = 1)


any advice would be greatly appreciated!

~M.
 

Similar Topics

HEllo, still satruggling with the curse WinCC Unified. See attached picture. I just want to change the fill colour from turqoise to grey and then...
Replies
5
Views
473
I have a Wincc project not for operating but for showing power & energy consumption with trends I have 7 trends and I want to change the trends...
Replies
1
Views
1,195
Hello gurus, i have a big problem with WinCC. What do i need? I need to create, dynamic table for all valves and motors in system. It will be...
Replies
8
Views
3,893
Hi everyone and happy new year. I am trying to make an objects visibility dynamic using vbs in a picture. In Screen, whenever i release the...
Replies
0
Views
2,245
Hi All, What i am trying to achieve is a dynamic tag(Device_1)[Text tag 16 bit] that monitors the state of another tag (Config_1)[unsigned 8 bit]...
Replies
1
Views
3,368
Back
Top Bottom