Win cc vb script

D Connaughty

Member
Join Date
Mar 2011
Location
Northern Ireland
Posts
6
Hello there,
I have been trying to assign a vb script to a button in graphics designer..... I created some internal tags in the win cc project. I wish that when a check box is selected, a value is added to another value upon a button being clicked. Below is the script I am using. Is there anything i am missing here? am i declaring the variables correctly? When the button is pressed I am expecting the result - which is "total" to be displayed in an i/o field. I have already tried this out in visual basic express 2010 and it works....
The "global script diagnostics window" also does not display anything when i press the button. Does the disgnostics window work if a vb script is only active in a picture - and not listed in the "project modules?"
Sub OnLButtonDown(ByVal Item, ByVal Flags, ByVal x, ByVal y)

Dim VGrp
Set VGrp = HMIRuntime.Tags.CreateTagSet
VGrp.Add "bin1sel"
VGrp.Add "bin1"
VGrp.Add "total"
VGrp.Read

If HMIRuntime.Tags("bin1sel").read = 1 Then
HMIRuntime.Tags("total").Value = HMIRuntime.Tags("bin1") + HMIRuntime.Tags("total")
End If

End Sub
 

Similar Topics

Hello, I need to have a script running all the time (variables mapping). I created a loop with an always true conduition and it works fine...
Replies
2
Views
3,150
Dear All, i am trying to connect Danfoss inverter with s7 200 cpu 226.but microwin shows following error at DATA Ptr.i assigned different VB...
Replies
1
Views
46
Hi All, Got a funny issue. I have a 1756-L85EP and a 1756-EN2TR in the same chase. The client asked for the Ferrari and the 3 lane highway!!! We...
Replies
1
Views
168
Dear Friends, I have face a lot of problems using Panelview Plus 7 Series B with Win10 IO: I can not map a netwaork drive, when using file...
Replies
0
Views
117
I'm writing some alterations to an FPWin program and need to see the running value of timers so I can set them correctly. It's my first time with...
Replies
0
Views
131
Back
Top Bottom