Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: japolta on March 07, 2013, 10:23:21 PM

Title: observed doOEMbutton anomaly in vb script editor
Post by: japolta on March 07, 2013, 10:23:21 PM
When executing an IF statement triggered by depressing a button on the joypad, DoOEMbutton(310) does not execute. However when using the debuging feature in Mach 3's VB scripting it does! I have placed a message statement in the statement so I know the logic is getting to the execution of DoOEMbutton(310), but axis simply doesn't move.
Example:
If True DoOEMbutton(310) : message "increment jog"

When debugging the axis jogs and the message is displayed in the status line. When using the external trigger, only the message is displayed and the axis does not move.

This programming approach works for other dobuttion (i.e. the dobutton combination that does REF HOME ALL). Only the axis jog buttons are unresponsive. I've got to be missing something here...a timing issue?? Even the most simple macro just executing a dooembutton(310) does the same thing -- it isn't the IF then logic messing this up.

Simple example:
DoOEMbutton(310) 'one line only no other programing

I'm sure the answer will be apparent to someone, but I'm pulling my hair out.... People use these dobuttons all the time in their programming to index lathes, but no one reports any problem and I'm not seeing them use any special conditions -- they just say "doOEMbutton(310)".

Are all dobuttons not created equal??
Title: Re: observed doOEMbutton anomaly in vb script editor
Post by: Chaoticone on March 08, 2013, 10:01:17 AM
No, not all buttons are created equal.  The jogs need to be functions rather than script if you can.  The problem with VB is it is not smart enough to recognize on press and on release.  If you get it to move useing the script, how are you going to stop it?

Brett
Title: Re: observed doOEMbutton anomaly in vb script editor
Post by: BR549 on March 08, 2013, 12:19:38 PM
ALSO this is NOT a valid Line in Mach CB

If True DoOEMbutton(310) : message "increment jog"

Just a thought, (;-) TP
Title: Re: observed doOEMbutton anomaly in vb script editor
Post by: japolta on March 08, 2013, 09:13:13 PM
Thanks for the reply.
I neglected to say that increment jog is in effect.  The axis only moves the discreet amount. It works fine when being debugged. I have found numerous examples of dooembutton (310) being executed as script usually jogging the lathe axis a discreet amount.  So I still remain confused.
BR549, I should have been clearer, I stylized the logic to keep the example simple.  You are correct.