Hello Guest it is March 28, 2024, 01:39:03 PM

Author Topic: Mach3 doesn’t read some VB Script.  (Read 6441 times)

0 Members and 1 Guest are viewing this topic.

Mach3 doesn’t read some VB Script.
« on: August 05, 2016, 03:02:40 AM »
Hello,

As you know, Mach3 loads a G-Code file (e.g. test.tap) and starts its Cycle.
In the G-Code file, you can use Macros (e.g. M333) after making M333.m1s file written by VB Script.
The problem is that Mach3 doesn’t read some files including Macros, displaying
 “Please wait…Generating Path….”, and never retrieve.
Or it sometimes reads, but stops at the Macro (e.g. M333), and never retrieve.

As you know, Mach3 has the VB Script Editor and Debugger..
From the debugger, the program runs perfect.
The program is shown as follows: (just a sample)

''Using G01 instead of G31
Code( "G01 X100 F200" )
While GetOEMLED( 825 )=0
Wend   'until Probe LED on
SetVar( 1000, GetABSPosition(0) )
DoOEMButton( 1003 )  'press stop
While IsMoving()
Wend
Code( "G01 X0 F2000" )

Any basic suggestions on how to run VB Script in Mach3 would be greatly appreciated. 

/E
Re: Mach3 doesn’t read some VB Script.
« Reply #1 on: August 21, 2016, 03:44:25 AM »
Hi Samrai,
I have just started to write my own scripts, its a challenge.

Encountered exactly the same problem you've described because the
script was stored in MachMill not MyMill.

Use Windows Explorer to check that the macro is in the profile you actually use.
...Mach3\macros\<your profile>\M.....

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach3 doesn’t read some VB Script.
« Reply #2 on: August 22, 2016, 12:26:09 AM »
Thanks for your advice, joeaverage.
Of course I had checked the macro location like
    ...Mach3\macros\<my profile>\M.....
And now I figured out that Mach3 doesn't accept some script such as
    DoOEMButton(1003) 'press stop buttom
maybe because Mach3 regards it as an abnormal operation.
Mach3 accepts normal operations such as
    DoOEMButton(1001) 'Feed Hold
    DoOEMButton(1000) 'Cycle Start

Thank you.
Re: Mach3 doesn’t read some VB Script.
« Reply #3 on: August 22, 2016, 07:55:21 AM »
Hi Samrai,
I've had the same difficulty but with setOEMDRO(143,0.0), ie trying to reset an encoder.
In fact I've encountered several encoder DRO's which it appears that I cannot directly
set but can read with getOEMDRO(n).

Haven't yet had any great insight as to why, but then I've only just started to write my own scripts.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach3 doesn’t read some VB Script.
« Reply #4 on: August 28, 2016, 08:44:59 PM »
Hello joeaverage,
According to Mach3Wiki, it is for "debug use only DRO".
That might be the why.
Re: Mach3 doesn’t read some VB Script.
« Reply #5 on: August 29, 2016, 04:04:06 AM »
Hi Samrai,
agreed it is for debug use. The corrected DRO, that is to say the DRO in units is 173.
Unfortunately I couldn't set that either. Worse when I read it getOEMDRO(173) it returns
the value in units OK but reading it again some time later it has incremented as if it
had a velocity component despite setting the velocity correction coefficient to zero.

Causing me some frustration! Confusion and frustration seem to be part and parcel
of learning something new. If I let frustration cause me to say 'to hell with it!' and
chuck it in then I certainly won't learn anything new.

I have a workaround that works and allows me to do the job I set out to do so I
can afford to be a bit patient about the 'understanding' and ask questions and confer
with others like yourself.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach3 doesn’t read some VB Script.
« Reply #6 on: August 31, 2016, 09:34:20 PM »
"Confusion and frustration seem to be part and parcel of learning something new"
Good words!