VB of WinCC problem

Join Date
Apr 2003
Location
Belgium
Posts
434
Hi there,

I'm relative new to VB, I got a small problem. I'm using WinCC with VBS, it's something like VBA in excel.

I've got one variable called Dummy, this var can contain three conditions namely 1,2 and 4. If it contains 1 then a tekst (Press 3)should be displayed in var Test and so on.
In fact it's a selection of 3 radio buttons, it depends on which button is clicked which tekst should be displayed.

I wrote the following code

Sub OnLButtonDown(ByVal Item, ByVal Flags, By Val x, By Val y)

Dim dummy, Test

Set Dummy = HMIRuntime.Tags(“Dummy”)
Set Test = HMIRuntime.Tags(“Test”)

If Dummy = 1 Then Test = (“Pers3”)
Else
If Dummy = 2 Then Test = (“Pers4”)
Else Test = (“Pers5”)
End IF
End IF
End Sub

What am I doing wrong ?
 
Fritz_frederix said:

Sub OnLButtonDown(ByVal Item, ByVal Flags, By Val x, By Val y)

Dim dummy, Test ??

Set Dummy = HMIRuntime.Tags(“Dummy”)
Set Test = HMIRuntime.Tags(“Test”)

If Dummy = 1 Then
Test = (“Pers3”)
Else
If Dummy = 2 Then
Test = (“Pers4”)
Else
Test = (“Pers5”)
End IF
End IF
End Sub


Is it that Capital letter 'd' in word dummy for ..Tags("Dummy")?
 
Last edited:
LaRocca said:
Why don´t you use select case?
How then with 100.000 to 1.000.000 cases ?
Use database, that is best for it. You can use
user defined display-text and non fixed number of
cases.
 

Similar Topics

We migrated a project from WinCC V 7.0 ( Windows XP) to WinCC V 7.5 (Windows 10).Every things okey .When the language translation button is...
Replies
0
Views
453
I have wincc flex 2008 project made with wincc flexible 2088 sp1 project hmi device is simatic pc panel 19" I want to change hmi device to run the...
Replies
17
Views
5,360
Hello During Compiling of WinCC Flexible Project It gives me following Error Internal error(Detail: cannot get parent folder-object type:VAR)...
Replies
1
Views
1,699
Hi everyone here, I'm facing a minor problem related to the WinCC Scada system which controls the desalination unit in the plant where I'm...
Replies
2
Views
1,492
Dear colleagues Actually, I have a problem with the communication in WINCC. we are developing a filling station for the lab for the students. we...
Replies
5
Views
4,266
Back
Top Bottom