Hello Guest it is October 23, 2019, 10:49:23 PM

Author Topic: VB Script to buttons...  (Read 2711 times)

0 Members and 1 Guest are viewing this topic.

VB Script to buttons...
« on: December 13, 2015, 11:47:42 AM »
Is there a way to 'Execute a Basic Script' to a button, but as a TOGGLE instead of two separate On/Off buttons and two
scripts?

I have a switch that I would like to run my dust extractor with....and I have set the Basic Script to ActivateSignal(OutPut2), which
works fine.  But I also need to turn it off...but preferably with the same button!

I guess I cannot do it with one button, but will need a second button to run DeActivateSignal(OutPut2)..?? 

Offline ger21

*
  • *
  •  6,288 6,288
    • View Profile
    • The CNC Woodworker
Re: VB Script to buttons...
« Reply #1 on: December 13, 2015, 06:09:42 PM »
if not isactive then
activate
else
deactivate
end if
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: VB Script to buttons...
« Reply #2 on: December 18, 2015, 05:33:56 PM »
Hi Gerry,

Thanks for the reply.  I've tried the script but get an error!  "Error on Line 1 - Argument not Optional"

I have checked that it's correctly spelled.  The 'Isactive' doesn't turn blue after I've typed it in the scripter...is that the problem?

This is what I have...

If Not Isactive Then
ActivateSignal(Output2)
Else
DeActivateSignal(Output2)
End If

Apologies for my ignorance...still learning this stuff!

Keith
« Last Edit: December 18, 2015, 05:38:11 PM by krsykes23 »
Re: VB Script to buttons...
« Reply #3 on: December 18, 2015, 07:11:45 PM »
If Not Isactive (Output2) Then
ActivateSignal(Output2)
Else
DeActivateSignal(Output2)
End If

I use similar but this way ...

If IsOutputActive(OUTPUT2) Then
DeActivateSignal(OUTPUT2)
else
ActivateSignal(OUTPUT2)
End if
Re: VB Script to buttons...
« Reply #4 on: December 19, 2015, 12:18:38 PM »
Hi Overloaded....worked a treat.  Thanks for the help!