next tool - need an integer available to my custom M code

More
05 Sep 2017 18:52 #98541 by docslip
My linuxcnc system works well and I've been a user since 2004. I do have a problem and have , thus far, been unable to solve.

I have written a bash script and called it M102. It fires up great but the argument I pass is not the next tool , from Tn, awaiting the m6.

I want to have the tool next value to index a list of photos which I will display on the monitor. All that is easy stuff but I cannot seem to get the iocontrol.0.tool-number into my axis environment. Global variable needed ?

Can you more experienced fellows help me ?

Bill Phillips
Thank you

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

More
05 Sep 2017 19:58 #98543 by bevins
selectedtool has the tool number.

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

More
05 Sep 2017 20:25 #98544 by Todd Zuercher
#<_selected_tool> is the global parameter for the selected tool (tool called before M6 is executed.)
#<_current_tool> is the global parameter for the current tool in the spindle (after M6)

The hal pins iocontrol.0.tool-prep-number and iocontrol.0.tool-number should should give the same values. (Although I think iocontrol.0.tool-prep-number is changed to 0 after an M6 until a Tn code is used.)

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

More
05 Sep 2017 20:29 #98546 by docslip
Thank you sir, but same result..My MDI command exactly is M102 P#<selectedtool> and every other conceivable way I can embrace the variables name: including M102 P#<_selectedname>. I've been failing at this ,otherwise simple op for 3 days, almost forgetting the goal.

ideas in the syntax required ?
Thanks

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

More
05 Sep 2017 20:35 #98547 by docslip
It works as expected, thank you. Of all that I have read not once was that global name discovered. Tell me young man, where should I have looked.

Thanks again.
Bill Phillips

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

More
06 Sep 2017 00:58 #98564 by Todd Zuercher

It works as expected, thank you. Of all that I have read not once was that global name discovered. Tell me young man, where should I have looked.

Thanks again.
Bill Phillips


Right here.
linuxcnc.org/docs/html/gcode/overview.ht...ub:system-parameters
The following user(s) said Thank You: docslip

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

More
06 Sep 2017 01:27 #98565 by docslip
Oh, I feel like such a stoop. I recall that page from years ago. Getting old is not for sissies.

Thanks again.

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

Time to create page: 0.066 seconds
Powered by Kunena Forum