Hello everybody!
I'm doing dynamically change of graphic object pictures by action script in the WinCC 7.0.
And it works only in the chain "else". Like something wrong with comparison value in the comprising operation, because vale is changed but in the end the picture is only set from "else" chain.
script:
I'm doing dynamically change of graphic object pictures by action script in the WinCC 7.0.
And it works only in the chain "else". Like something wrong with comparison value in the comprising operation, because vale is changed but in the end the picture is only set from "else" chain.
script:
Function PictureName_Trigger(Byval Item)
Dim icon
Dim user
Set user = HMIRuntime.Tags("CurrentUser")
HMIRuntime.Screens("MainStructureMenu").ScreenItems("UserIcon")
Set icon = HMIRuntime.ActiveScreen.ScreenItems("UserIcon")
Select Case user.Value
Case "Administrator"
icon.PictureName = "Administrator.png"
HMIRuntime.Tags("it_user_reg").Write 1
Case "Operator1"
icon.PictureName = "Client1.png"
HMIRuntime.Tags("it_user_reg").Write 2
Case "Operator2"
icon.PictureName = "Client2.png"
HMIRuntime.Tags("it_user_reg").Write 3
Case else
icon.PictureName = "Client3.png"
HMIRuntime.Tags("it_user_reg").Write 0
End Select
End Function