Hello Guest it is May 25, 2025, 12:31:07 PM

Author Topic: Mach4 PMC Cycle Start problem  (Read 7548 times)

0 Members and 1 Guest are viewing this topic.

Mach4 PMC Cycle Start problem
« on: April 21, 2022, 11:03:55 AM »
Hello
I used an external button via the PMC for the Cycle Start command.
The button works perfectly for the cycle start of a program but does absolutely nothing for MDI.
Do you have any idea why MDI differs from the window where the program is loaded (Gcode)?

Offline jbuehn

*
  •  101 101
Re: Mach4 PMC Cycle Start problem
« Reply #1 on: April 21, 2022, 12:08:19 PM »
You could look at the code behind the Cycle Start button on the screen, but it's basically calling a different API based on whether the GCode tab is active, or the MDI tab is active.

If the GCode tab is active it calls the Cycle Start API. If the MDI tab is active it calls a different API (can't remember which one off the top of my head) to run your MDI command.
Re: Mach4 PMC Cycle Start problem
« Reply #2 on: April 22, 2022, 04:35:31 AM »
Thanks for the reply.
So theoretically it would be more functional to make a script to link the external button directly to the Cycle Start button on the screen !?
However, it is strange to build a Cycle Start in PMC that does only half of what it should!

Offline jbuehn

*
  •  101 101
Re: Mach4 PMC Cycle Start problem
« Reply #3 on: April 22, 2022, 01:41:57 PM »
I haven't used the PMC much so there may be a way to do it in there?

Otherwise you could use the signal library in the screen load script. When your button input goes high, call the same same CycleStart() function the screen's Cycle Start button calls...plus any other logic you may have in the PMC script.

If you're unfamiliar with the signal library stuff, there's some good info on this forum. Craig has some nice intro stuff here:
https://www.machsupport.com/forum/index.php?topic=40051.msg267764#msg267764
Re: Mach4 PMC Cycle Start problem
« Reply #4 on: April 22, 2022, 02:21:16 PM »
Hi JBUEHN
I made a script for cycle start and now it is functional for MDI as well.
It's a pity that the PMC doesn't work properly, I had another problem with it, after doing enough program lines I couldn't open it except with the new version 2.0.4612, in the old version 2.0.4300 it can't be open anymore, and honestly the new version doesn't really appeal to me, it has a lot of moodiness.
Thanks!
Re: Mach4 PMC Cycle Start problem
« Reply #5 on: September 07, 2024, 02:24:02 AM »
Hello DanielS,
Would you be willing to post the script you ended up writing for the signal library, for you cycle start button?  I was successful in setting up a button to activate my tool-release solenoid/draw bar (using the PMC editor) but did not have any success with the cycle start button at all, not even on just the gcode screen.  I have written something simple in the signal library, but still have it commented out, and figured that I would look into this further before uncommenting out.  Did you have to do anything special for handling the way it will start running a program on the gcode screen versus the mdi screen?  Thanks
Jesse
« Last Edit: September 07, 2024, 02:26:02 AM by jhesch »
Re: Mach4 PMC Cycle Start problem
« Reply #6 on: September 07, 2024, 04:10:23 AM »
Put this script in the Screen script/Signals library, and choose your input pin
Re: Mach4 PMC Cycle Start problem
« Reply #7 on: September 22, 2024, 06:48:42 PM »
Thanks for the super fast response DanielS!  I did get that to work.  I appreciate your help.

Here is some extra info that might save someone else a headache in the future.  After setting this up I did learn something the hard way.  Before reaching out for help on the start button issue, I had added a script I made in PMC editor, so that I could use a button to activate the drawbar on a new FM30F spindle.  I am going to be replacing the stock spindle on a Langmuir Systems MR1 mill.  And, I am bench testing/configuring it in mach4 (paired with an ess).  I want to get the entire mill configured in mach4 on the bench before I tear apart my functioning, stock MR1 electronics cabinet and convert it to use mach4 and the ess.  Long story short, the logic I had integrated into the pmc script would prevent the drawbar button from actuating while the spindle was in the on state, but this apparently does not work when using the start button to begin a program, and I had nearly ruined my brand new $5k spindle setup while bench testing.  I should have done another method of testing this, but I thought it was sorted and did not expect mach4 to behave differently based on the start button script.  I will be implementing a hardware solution in the future to prevent this. 
Re: Mach4 PMC Cycle Start problem
« Reply #8 on: September 23, 2024, 01:43:03 AM »
Hi Jhesch.
I think the best method is to use an external PLC, especially since now a PLC can also be made from an arduino NANO.
The problem with the PLC in the software is that behind what you see as a ladder there is also a Script, which can easily conflict with the basic Mach4 Script. With an external PLC, you rely on electrical I/O signals that, if they are not executed, everything will come to a standstill, and you can check the I/O signals much more easily.
It is ok to use the PMC for simple things like Jogging the axes, but when it involves things related to the safety of the machine and the operator, I would not leave it to the PMC and I would implement a separate PLC.