Hello Guest it is May 13, 2021, 02:25:02 AM

Author Topic: Help with Mach 4 controlling a PLC for tool changes.  (Read 11527 times)

0 Members and 1 Guest are viewing this topic.

Re: Help with Mach 4 controlling a PLC for tool changes.
« Reply #50 on: January 28, 2018, 08:46:01 PM »
DERP!!! AHHHHH Well I feel stupid. I did program a button to make the carriage go to the tool change position and I knew it then, but forgot....My Mach Coord is 0,0, so it would be negative!!! I was trying to go positive! I feel stupid.

I put in the code above but, mc.mcCntlGcodeExecuteWait(inst,"G53 G00 X-0.25 Z-0.25") and it works perfectly.

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: Help with Mach 4 controlling a PLC for tool changes.
« Reply #51 on: January 29, 2018, 01:43:27 PM »
Quote
and it works perfectly

Does it really? Just curious, do the dros update while moving to the tool change position the M6 told it to go to?
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Help with Mach 4 controlling a PLC for tool changes.
« Reply #52 on: January 29, 2018, 02:03:18 PM »
Don't know. I'll check and let you know.
Re: Help with Mach 4 controlling a PLC for tool changes.
« Reply #53 on: January 29, 2018, 06:59:09 PM »
Yes the DROs update. Why do you ask, you seemed surprised?
Re: Help with Mach 4 controlling a PLC for tool changes.
« Reply #54 on: January 29, 2018, 07:43:15 PM »
Are the DROs showing the move rather than just updating the DRO when it arrives?
Using a mc.mcCntlGcodeExecuteWait can lock up the GUI until the move is finished, then the DROs will populate.
I was curious about this today, I'm guessing that's why Chaticone asked as well. 
Chad Byrd

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: Help with Mach 4 controlling a PLC for tool changes.
« Reply #55 on: January 29, 2018, 09:21:49 PM »
Yes the DROs update. Why do you ask, you seemed surprised?

Chad explained it pretty well. I do not think the DROs will update as the move is being performed. They will update once the location is reached but I think using the GcodeExecuteWait call from your mCode macro will lock up the gui until that call is finished.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: Help with Mach 4 controlling a PLC for tool changes.
« Reply #56 on: January 29, 2018, 09:25:30 PM »
Ah, I didn't notice.

Does that make a difference if it's locks up the GUI? I mean I'm running code and have to let it complete first anyway.
Re: Help with Mach 4 controlling a PLC for tool changes.
« Reply #57 on: January 29, 2018, 09:41:01 PM »
I mean, In my opinion its fine, it just doesn't allow the GUI to do anything else until the move is completed.  No longer than that will take to move the machine to a "Tool Change Position" you should be fine.
But, like I said earlier in this post, Daz put that video up on modules.   Chatoicone, correct me if I'm wrong, but I believe that this will let you put a function() in the macro to handle this without interrupting the GUI.
Chad Byrd
Re: Help with Mach 4 controlling a PLC for tool changes.
« Reply #58 on: January 29, 2018, 09:53:12 PM »
If I'm running Gcode I can't use the gui anyway, right?

I'll look at the modules thing.

Offline Chaoticone

*
  • *
  •  5,626 5,626
  • Precision Chaos
    • View Profile
Re: Help with Mach 4 controlling a PLC for tool changes.
« Reply #59 on: January 29, 2018, 09:53:43 PM »
Quote
Chatoicone, correct me if I'm wrong, but I believe that this will let you put a function() in the macro to handle this without interrupting the GUI.

Yup, that's right. Or more of what I was thinking is it would allow you to call a function in a module from the macro. In the module you would have your coroutine and other bits.

;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!