Reload Program Through Pin

More
24 Aug 2015 03:01 #61715 by PCW
Replied by PCW on topic Reload Program Through Pin
Thats why I was suggesting a race condition, a script that changes the mode
may have to wait until the mode change occurs before proceeding with operations that depend on the
requested mode change

Please Log in or Create an account to join the conversation.

More
24 Aug 2015 03:28 #61717 by BigJohnT
Replied by BigJohnT on topic Reload Program Through Pin
Exactly, if your changing to mdi mode you must wait for halui.mode.is-mdi to be true before marching on in your program.

JT

Please Log in or Create an account to join the conversation.

More
24 Aug 2015 03:57 #61719 by Delron
Replied by Delron on topic Reload Program Through Pin
Tried all that, I think....

Can you do it in a M-code? Did not seem to work for me.

Please Log in or Create an account to join the conversation.

More
24 Aug 2015 04:12 #61720 by Delron
Replied by Delron on topic Reload Program Through Pin
Here is one I tried with no success


M101

#!/bin/sh
halcmd setp halui.mode.mdi true
axis-remote -m "o100 call"
halcmd setp halui.mode.manual true
axis-remote —reload &
exit 0

Sure would like to see Linuxcnc create a method to deal with this problem in the next release.

Please Log in or Create an account to join the conversation.

More
24 Aug 2015 04:28 #61721 by PCW
Replied by PCW on topic Reload Program Through Pin
Still not convinced there is a problem

Nothing you have shown checks that the state has changed to the desired state before proceeding

Please Log in or Create an account to join the conversation.

More
24 Aug 2015 04:31 - 24 Aug 2015 04:36 #61722 by Delron
Replied by Delron on topic Reload Program Through Pin
I'm not sure where I can check the state from for this to work?
Can the M-code do logic?

Would I place the hali.mode.is-manual in the M-code file and check there?
How do I pause the m-code until it is in manual mode before proceeding with the reload?
Can you give an example?
Last edit: 24 Aug 2015 04:36 by Delron. Reason: More questions

Please Log in or Create an account to join the conversation.

More
24 Aug 2015 04:40 #61723 by Delron
Replied by Delron on topic Reload Program Through Pin
Ok, I think it's behaving I little more here, however, I cannot get the m-code to put the machine back to manual mode after the reload.??

Please Log in or Create an account to join the conversation.

More
24 Aug 2015 04:45 #61724 by PCW
Replied by PCW on topic Reload Program Through Pin
Not the most elegant way but
a bash while loop in your script waiting for

halcmd getp halui.mode.is-mdi | grep true

Having a 0 exit code is a possibility for waiting for mode changes

Please Log in or Create an account to join the conversation.

More
24 Aug 2015 05:55 #61725 by BigJohnT
Replied by BigJohnT on topic Reload Program Through Pin
I might add this would be a trivial task in Classicladder... turn a pin on and wait for a response is what ladder logic is good at.

JT

Please Log in or Create an account to join the conversation.

More
24 Aug 2015 06:01 #61727 by Delron
Replied by Delron on topic Reload Program Through Pin
So many hoops to go through just to reload a program after a touch-off.
I think I give up. Was hoping to run my machine mostly from the pendant, but I guess I'll have to keep a keyboard and or mouse nearby.

Please Log in or Create an account to join the conversation.

Time to create page: 0.236 seconds
Powered by Kunena Forum