Hello Guest it is January 19, 2022, 05:18:45 PM

Author Topic: help withusing vbscript to "feedhold" gcode execution  (Read 5640 times)

0 Members and 1 Guest are viewing this topic.

help withusing vbscript to "feedhold" gcode execution
« on: October 16, 2016, 04:14:33 PM »
Hi,

I am trying to write a macro with vbscript which will call feed hold using "DoOEMButton(1001)" but mach3 seems to blow right through the macro and the code does not pause in the same way it would if i hit space bar or click thefeed hold button on the default mill screen set. Is this the correct way to call a feedhold from a macro?

I found the feedhold button info on this page:
http://www.machsupport.com/Mach3Wiki/index.php?title=OEM_Buttons

Some background in case there is a better idea for doing what i want instead of feed hold:

I have multiple vise setup holding many blanks that will all get the same machining done on them.

I have a gcode that changes coordinates, calls the main part to cut the part several times etc, this all seems to work perfectly once the coordinate systems are setup.

What i desire is that at the beginning of each copy mach3 prompts the operator to verify the XY Zero is lined up. To check this i have a camera on the spindle, so the gcode moves the camera to what it thinks the XY zero for each respective part is before it cuts it. If it is not lined up I want the user to be able to jog the spindle to line up the camera, reset the coordinate system offset, and then continue.

My first attempt at this was to make MsgBox in vbscript that more or less says "is it ok" and you have yes or no. if yes it just continues, but if the msgbox returns no i call "code" M0", the spindle stops, you can jog, use some buttons i made to reset the coordinates once the camera is aligned.

This is almost a good enough solution EXCEPT i dont want the spindle to stop if i have to re align. And it seems that you cant jog once the msgbox is up.  So from what i understand a macro that just causes a feedhold would be excellent and i would not even need a msg box because for example, the gcode execution  would just pause at the beginning of each piece, and the operator can just correct the XY zero if needed and then hit cycle start again. I have tested with pressing space bar to feed hold and it does appear you can jog in feedhold hence why i think it may be the solution.

Any comments suggestions would be appreciated, while i have some experience making screen sets and other simple macros, i can't really think why the feedhold does not happen/do not have the deepest understanding of the software.
« Last Edit: October 16, 2016, 04:20:38 PM by fredeflint »

Offline TPS

*
  •  2,213 2,213
    • View Profile
Re: help withusing vbscript to "feedhold" gcode execution
« Reply #1 on: October 17, 2016, 03:02:30 AM »
hi,
i am not sure, but you can try also:

DoButton(1)

should be the same, but let's try.

Thomas
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: help withusing vbscript to "feedhold" gcode execution
« Reply #2 on: October 17, 2016, 05:45:40 AM »
By definition, feedhold only works when there's movement TO feedhold.

Whilst an M code is running, there IS no movement.

Try an M1 instead and see if that does what you want. (remember to enable it).

Offline RICH

*
  • *
  •  7,422 7,422
    • View Profile
Re: help withusing vbscript to "feedhold" gcode execution
« Reply #3 on: October 17, 2016, 08:08:32 AM »
Not an answer to your question.........................

Maybe consider setting up differently and use Work Offsets.
ie; Use camera to locate each work piece held in the vice to define work offset for each piece then run the same program code.

RICH

Offline RICH

*
  • *
  •  7,422 7,422
    • View Profile
Re: help withusing vbscript to "feedhold" gcode execution
« Reply #4 on: October 17, 2016, 09:11:50 AM »
Quote
while i have some experience making screen sets and other simple macros

Why not have some fun..................... automate the setup if your constantly making multiple parts in multiple fixtures.

Consider creating a screen page or set which would have vises along with DRO's for each vise or part in them.
Also have buttons to create the  different Work Offsets.
Simply put, could use the laser dot to locate work / vise or whatever and use the buttons to populate the Work Offset table.
OR
Maybe even refine the above to probe the locations.

Have a look in the Mach Tool box as you can use some wizards as a starting point for the screen and VB.

Something to think about,

RICH
Re: help withusing vbscript to "feedhold" gcode execution
« Reply #5 on: October 17, 2016, 10:28:17 AM »
hi,
i am not sure, but you can try also:

DoButton(1)

should be the same, but let's try.

Thomas


OK i will try and let you know.
By definition, feedhold only works when there's movement TO feedhold.

Whilst an M code is running, there IS no movement.

Try an M1 instead and see if that does what you want. (remember to enable it).


Ok i will also try this.


Not an answer to your question.........................

Maybe consider setting up differently and use Work Offsets.
ie; Use camera to locate each work piece held in the vice to define work offset for each piece then run the same program code.

RICH

I already do this i think. basically i use G59 PX where X is the number of the vise say. THe GCODE is a bit more complicated because i also have on the screen buttons to turn on and off certain vise, in case i don't have all full load etc, then macros called from the gcode check the led state and branch the gcode accordingly to skip pieces.. I don;t use separate DROS for each piece though, but otherwise i think i am already doing most of what you suggested.  I attached a shot of my screen so far to give you an idea.

But nothing to do with the screen/gcode  is really causing issues i haven't been able to solve, i just want to be able to pause and then jog mid code without stopping the spindle, which i cant do yet.

THank you for the suggestions, i will try the out and report back tomorrow.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: help withusing vbscript to "feedhold" gcode execution
« Reply #6 on: October 17, 2016, 10:43:33 AM »
hi,
i am not sure, but you can try also:

DoButton(1)

should be the same, but let's try.

Thomas


OK i will try and let you know.

No point. This is just the legacy way of doing a feedhold so for the reasons I've given above it won't work.
Re: help withusing vbscript to "feedhold" gcode execution
« Reply #7 on: October 17, 2016, 10:57:44 AM »
hi,
i am not sure, but you can try also:

DoButton(1)

should be the same, but let's try.

Thomas


OK i will try and let you know.

No point. This is just the legacy way of doing a feedhold so for the reasons I've given above it won't work.

Can you feed hold a dwell? (G4?)

this might work if so... dwell for a time long enough to execute the macro which calls doButton? i am not at my machine today so i can;t try....
Re: help withusing vbscript to "feedhold" gcode execution
« Reply #8 on: October 18, 2016, 11:33:14 PM »
By definition, feedhold only works when there's movement TO feedhold.

Whilst an M code is running, there IS no movement.

Try an M1 instead and see if that does what you want. (remember to enable it).


looks like this is the ticket. thank you for your help.

ftr it does not look like you can feed hold a g4 command.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: help withusing vbscript to "feedhold" gcode execution
« Reply #9 on: October 19, 2016, 04:21:58 AM »
looks like this is the ticket. thank you for your help.

No worries.

ftr it does not look like you can feed hold a g4 command.

By definition, feedhold only works when there's movement TO feedhold.