Hello Guest it is April 14, 2021, 01:51:08 AM

Author Topic: Getting Outputs from Mach3  (Read 6997 times)

0 Members and 1 Guest are viewing this topic.

Getting Outputs from Mach3
« on: January 30, 2013, 09:00:57 AM »
Hi
    I have a 5 axis breakout board but only use 3 axes, so I have some spare outputs ,
A step , A direction , A enable , B step, B direction and B enable

On my pendant I wish to have 3 LEDs to indicate the jog increment step 1mm , 0.1mm , 0.01mm
my plan was to use these spare outputs on the B.O.B  to drive the LEDs .

Can someone tell me if its possible and if so how I can get Mach3 to output 3 signals when the
1mm , 0.1 or 0.01 jog increment is enabled

I am ok at making inputs work  and I can see that an easy way around my problem might be to
design 3 buttons on screen and assign each one a hotkey and an OEM code in the range
191 -200 which I think are the jog steps in the list of ten on the config/general config page.
My Pendant has a keyboard encoder in it  so I could use  3 buttons to give me the hotkeys which
then trigger the OEM codes   

But I would sooner use ALT J to cycle through the jog increments and have LEDs indicate which is selected

Can it be done?

Don

Offline Hood

*
  •  25,838 25,838
  • Carnoustie, Scotland
    • View Profile
Re: Getting Outputs from Mach3
« Reply #1 on: January 30, 2013, 01:21:59 PM »
Easiest way would likely be the macropump
Just have something like

If GetOemDRO(828)=1 Then
ActivateSignal (OutPut1)
Else
DeActivateSignal(OutPut1)
End If

If GetOemDRO(828)=0.1 Then
ActivateSignal (OutPut2)
Else
DeActivateSignal(OutPut2)
End If

If GetOemDRO(828)=0.1 Then
ActivateSignal (OutPut3)
Else
DeActivateSignal(OutPut3)
End If

Hood
Re: Getting Outputs from Mach3
« Reply #2 on: January 31, 2013, 07:40:07 AM »
Hi Hood
             Once again thanks for your help

Rather than just copy and use the help someone gives me I like to try and understand it so then just maybe
next time I can work it out for myself .

I am assuming that GetOemDRO(828)  is the little window that shows the jog increment  ?
How did you know it was 828 , is there a list that I havent found yet ?

So I think your code is saying if there is a one in the window , turn on output1
and if there isn't then turn output1 off

and the same for output2 with 0.1
and output3 with 0.01

That makes sense ( assuming my understanding is correct)

when you say output 1,2 or 3 I am guessing I will set that up in config/ports pins / outputs and give output#1 ,#2 or #3 the
port and pin numbers I have free

Now need to learn about Macro pump so I can implement your code. I guess there will be a tutorial or video somewhere ,
I shall go and look for it now

Thanks again Hood

Don


Offline Hood

*
  •  25,838 25,838
  • Carnoustie, Scotland
    • View Profile
Re: Getting Outputs from Mach3
« Reply #3 on: January 31, 2013, 07:49:57 AM »
There is a list in a sticky at the top of the forum, "OEM codes for buttons, DRO's and LED's" there you will find a xls file with the OEM codes for buttons, LEDs etc There is also the same list on the wiki, I just put it in the Excel document so you can search easily and donthave to go online to the wiki.

Yes what you are thinking is correct and yes for that code you would have to set up in ports and pins to Output 1, 2 and 3 but you could change to other outputs if you are already using these ones.

The macropump is a file in the macro folder of the profile you use, eg if you use a standard Mill profile it will be in the folder c:\Mach3\Macros\Mach3Mill   To open you can go to Operator menu in Mach then Edit VB Script and a window will open, browse to your folder and open Macropump.m1s then paste in the above (or modified for your outputs) then save and close. Next go to Config menu in Mach then General Config and on the right you will see Use Macropump, choose that and restart Mach and it should work.
Hood
Re: Getting Outputs from Mach3
« Reply #4 on: January 31, 2013, 07:53:59 AM »
I went to the machsupport page and clicked on
support then tutorial videos and clicked the link  Artsoft Video Tutorials

down the left of the page that appeared I clicked on
" Introduction to Macropumps"  but rather than get a video tutorial as I expected
I got a picture of the Mach3 screen

I feel daft now but , how do I get the video to play ?

Don
Re: Getting Outputs from Mach3
« Reply #5 on: January 31, 2013, 07:55:14 AM »
Ah , you must have posted while I was writing my last post.

I will follow your instructions , but it would still be nice to be able to play the videos

Don

Offline Hood

*
  •  25,838 25,838
  • Carnoustie, Scotland
    • View Profile
Re: Getting Outputs from Mach3
« Reply #6 on: January 31, 2013, 07:56:59 AM »
Scroll down and you should see the Play button, see screenshot below.
Hood
Re: Getting Outputs from Mach3
« Reply #7 on: January 31, 2013, 08:06:24 AM »
Thanks for that ,
the video is running now , I feel pretty stupid not seeing it , but it was off
the bottom of the screen

went to open macropump.m1s  but I dont have one

have lots of others , spindlespeed , hiddenscript  and lots that start with m10, m11 m41 etc

should I just make a new one and call it macropump ?

Don

Offline Hood

*
  •  25,838 25,838
  • Carnoustie, Scotland
    • View Profile
Re: Getting Outputs from Mach3
« Reply #8 on: January 31, 2013, 08:14:19 AM »
Yes you can either open any macro and then delete whats in an paste or type in what you want then choose Save As and call it macropump.m1s
You could do the same with opening notepad and putting your info in then saving as Macropump.m1s.
Hood
Re: Getting Outputs from Mach3
« Reply #9 on: January 31, 2013, 08:38:36 AM »
IT WORKS !!! IT WORKS !!!  :D :D :D

Thanks to your help it is now working just as it should.
Now I shall see if I can work it out for myself how to do
the same with the  jog mode Step / Continuous indicators

I am assuming i will be looking for OEM codes for LEDs this time rather than DROs

Thanks for the help

Don