Hello Guest it is April 19, 2024, 07:46:31 PM

Author Topic: Problem in OEM button  (Read 2516 times)

0 Members and 1 Guest are viewing this topic.

Problem in OEM button
« on: December 21, 2015, 01:10:28 PM »
Hi everybody,

I made a button and LED on a new screen by Screen4 together with the following VB script in Macropump. However, when the button is pressed, the LED won't lit. Can anybody advise what's wrong with it... Or, my concept goes wrong!

Sub Main

If GetOemButton(2000)=1 Then
SetUserLED(1000,1)
Else
SetUserLED(1000,0)
End If

End Sub

Thanks in advance.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Problem in OEM button
« Reply #1 on: December 21, 2015, 06:47:38 PM »
There is no GetOEMButton Function.

Just use this code in the button. No need to put this in the macropump.

If Not GetOEMLED(1000) Then
SetUserLED(1000,1)
Else
SetUserLED(1000,0)
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: Problem in OEM button
« Reply #2 on: December 22, 2015, 07:57:17 AM »
I can't get it.

Originally, in my new added control button in the screen, I entered 2000 in the blank of OEM Code Function and its box was checked. Whereas, in LED one, I entered 1000 in OEM Code Function.
In your codes, there is only OEM LED 1000, I don't know how button and LED are linked together and ,which location the codes should be placed? Sorry for that I am a newbie of in screendesigner.....

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Problem in OEM button
« Reply #3 on: December 22, 2015, 08:06:38 AM »
In Screen 4, configure the button to execute VB Script.
Then, in Mach3, go to the Operator menu, and select "Edit Button Script". Click on the button, and enter the code I posted in the script editor that opens. Go to File > Save in the VB editor, then close it.

When you click the button, it will toggle the LED on and off.

I'm not sure if 1000 is a valid User LED number. You might ant to use a higher vale, over 1200 or so?
Gerry

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

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Problem in OEM button
« Reply #4 on: December 22, 2015, 09:59:33 AM »
Thanks a lot, it works now. This information is very helpful which I can't find out anywhere in net...