Hello Guest it is April 26, 2024, 04:37:30 AM

Author Topic: HOW TO DETECT THAT IS RUNNING MACH3 IN POKEYS57CNC  (Read 11534 times)

0 Members and 1 Guest are viewing this topic.

HOW TO DETECT THAT IS RUNNING MACH3 IN POKEYS57CNC
« on: October 30, 2016, 11:14:39 AM »
Hello everyone,
I am developing a device to manually control my CNC router through a PoKeys57CNC programmed with PoBlocks. This device can generate pulses through its internal pulse generator to operate autonomously without being connected to a PC. I can move the axes with several MPG, enter coordinates, or enter a distance to travel for each axis. This works very well. The problem occurs when the pulse generator has Mach3 takes control and the program generated with PoBlocks is not aware that Mach3 took control. I need to be able to say PoKeys57CNC program, which is Mach3 which has control. For this I thinking about two systems:
1. Capture Charge Pump signal generated by Mach3: I can not do this by setting some of the I / O PoKeys57CNC as input to detect the pulse of 12.5 kHz. I do not know if it is possible.
2. Through macropump: I set PoKeys57CNC plugin for Mach3 communicates through UserDRO range 1100 to 1127 (see attached image). It works well, for example, pressing the button that activates the active Mist UserDRO 1100. With other events that occur during operation of Mach3 I can activate and deactivate other UserDRO. The problem is that I do not get any events that tells me that Mach3 is working (properly). I have tried to detect through the VB-script when the Alt + F4 keys (closed session) are pressed, so that, before closing the session Mach3 the macropump change the status of the selected UserDRO, but neither I succeeded.
I thank you in advance for your help.
Re: HOW TO DETECT THAT IS RUNNING MACH3 IN POKEYS57CNC
« Reply #1 on: November 14, 2016, 02:06:00 AM »
Nobody can help me? I can not advance in my project if I can not send to the Pokeys57CNC any signal from Mach3 to inform that the program is active and that (this is the tricky part) tells you when Mach3 is going to close. Thank you for your help.
Re: HOW TO DETECT THAT IS RUNNING MACH3 IN POKEYS57CNC
« Reply #2 on: November 29, 2016, 10:00:13 AM »
Charge pump signal should work?  

I am working in a custom screen set so I cant remember if the Mach3 1024.set has an LED for the charge pump, I believe it does, if not you can just create one.  Use that LED and a shared data slot to send the signal to the Poblocks program.

The trick is to create a brain that watches the LED status.  An active LED in Mach3 will output a 1, inactive will be a 0.  This 1 and 0 can be sent to a DRO (has to be a custom DRO and the DRO needs to be a Mach3 to Pokeys shared ouput slot 21-27.

So when the charge pump LED is active it will send a 1 to the DRO and a 0 when it is inactive.  The DRO value can then be sent from Mach3 to Pokeys.  In your Pokeys program you can use this on/off signal for whatever you need.  Its a work around but it does work.  It would be nice if PoBlocks could read the logic state of Mach3 LED's.
 
Re: HOW TO DETECT THAT IS RUNNING MACH3 IN POKEYS57CNC
« Reply #3 on: November 29, 2016, 04:21:25 PM »
Hello,
 just an example ;)
Re: HOW TO DETECT THAT IS RUNNING MACH3 IN POKEYS57CNC
« Reply #4 on: November 29, 2016, 04:56:27 PM »
Yep, just like eurohoppel posted.

You will have to give the DRO a number that can utilize the shared slots in Poblocks. (Mach to Poblocks not Poblocks to Mach). 

So if your starting your shared slots on DRO 1100 and you want to send this on/off signal from Mach3 to the Poblocks application you will used a DRO numbered between 1121 - 1127.

Again, its kind of a work around but it does yield a result.  I use this same method for two LED status signals.

Re: HOW TO DETECT THAT IS RUNNING MACH3 IN POKEYS57CNC
« Reply #5 on: November 30, 2016, 03:44:21 PM »
Thank you very much for your help. I tried the brain example that you gave me but I can not make it work with the charge pump. To verify that there is good communication with PoKeys57CNC I modified the brain as I attached it. I've been able to enable and disable an output on the PoKeys57CNC by pressing Flood Toogle, so I deduce that the communication is set. I do not know if the problem is that I have some bad settings in Mach3 where the chargepump is not activated.
Re: HOW TO DETECT THAT IS RUNNING MACH3 IN POKEYS57CNC
« Reply #6 on: November 30, 2016, 04:41:06 PM »
Another method would be to jumper an output pin (Mach plugin selected output) say, "Pin 45 charge pump" on the 57cnc board to another pin setup as an input on the poblocks side.  You have to remember than if a pin is being used on the Poblocks side that you don't configure it on the pokeys plugin for Mach3.

So in essence, set up pin 45 (dedicated charge pump pin on the 57cnc board) with a jumper wire to any other open i/o pin on the board.  In Poblocks setup that pin as an input for you logic level needs.

When the charge pump is active it will send an output signal that can be read by the input side of the poblocks app.

I have not tested this method with the charge pump but have with a standard output from Mach to an input on the poblocks side.
Re: HOW TO DETECT THAT IS RUNNING MACH3 IN POKEYS57CNC
« Reply #7 on: November 30, 2016, 06:00:42 PM »
I already tried to use the Pokeys57CNC charge pump signal output on pin 45. This output generates a signal of 5Khz when the pulse engine is active, but it is independent of whether Mach3 is active or not. That is to say, whether the pulse generator is the Mach3 or if it is the pulse engine of the PoKeys57CNC, I get the 5 kHz signal on the pin 45.
What I need is to be able to tell PoKeys57CNC in some unequivocal way that Mach3 is in control.
The solution with the brain seems appropriate, but I do not understand why I do not get the signal of the charge pump of Mach3. Do you know any way to check if Mach3 is generating the charge pump signal?
Re: HOW TO DETECT THAT IS RUNNING MACH3 IN POKEYS57CNC
« Reply #8 on: December 01, 2016, 10:51:50 AM »
Correct me if I am wrong but doesn't the Pokeys Mach3 plugin override any pulse engine generators setup in Poblocks?  If so then the Poblocks pulse engines would become inactive when Mach3 is running.

Another method would be to just use the E stop led in the brain vs the charge pump.  Mach3 starts up in E-stop active mode and the signals can be used as described above in a brain to poblocks setup.

But again.  On my end when I setup a poblocks utilizing a pulse engine block configuration it works as long as Mach3 is not running.  When Mach is active the poblock pulse engine is ignored.

 

 
Re: HOW TO DETECT THAT IS RUNNING MACH3 IN POKEYS57CNC
« Reply #9 on: December 01, 2016, 02:14:03 PM »
That was what I expected. Your reflection has made me try again.

What I have discovered is that if I enable the charge pump in the Pokeys57CNC using the PoKeys software, when I move the motors manually with the MPG without connection to the PC, the 5 kHz pulse is generated by the pin 45. So far everything is fine.

If I connect Mach3 and in the plugin I do not have the "enable safety charge pump" box checked, the / Mach3 plugin modifies the configuration I made with the PoKeys software and the charge pump stops working. In the same way, if I activate the "enable safety charge pump" box of the plugin from Mach3, I always get the signal of 5khz when Mach3 is connected, even if the motors do not move! So it does not help me at all.

I can not use the signal from Estop. When connecting Mach3 would have a "signal" connection, since when starting Mach3 always starts with the Estop enabled and would be worth as a message for PoKeys57CNC: "Mach3 has come into operation, let it take control."

But the problem is to inform PoKeys57CNC when Mach3 stops working. I have clear how to activate a communication signal from Mach3 to PoKeys57CNC through macropump or a brain. But how do I send another signal to PoKeys57CNC when I press the button to close the application from the PC?

In other words. In macropump, how do I check if the red cross button was pressed to close the application? And how do I command through the macropump Mach3 shutdown ?. If I can control this, I will be able to program the disconnection of an OEM LED and then allow Mach3 to close.