Hello Guest it is March 28, 2024, 10:23:16 PM

Author Topic: observed doOEMbutton anomaly in vb script editor  (Read 3297 times)

0 Members and 1 Guest are viewing this topic.

observed doOEMbutton anomaly in vb script editor
« 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??

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: observed doOEMbutton anomaly in vb script editor
« Reply #1 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
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: observed doOEMbutton anomaly in vb script editor
« Reply #2 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
Re: observed doOEMbutton anomaly in vb script editor
« Reply #3 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.