NEWS
LinuxCNC 2.5.2 Release
LinuxCNC 2.5.2 Update Released (changelog).
 
LinuxCNC 2.5.1 Release

LinuxCNC 2.5.1 Update Released (changelog). If the Package Manager does not prompt you to upgrade see this page.

 
LinuxCNC 2.5.0 Release
New major release (changelog). See the instructions to update your system from EMC 2.4 to LinuxCNC 2.5.
 

Welcome, Guest
Username: Password: Remember me
Use subroutines with caution

TOPIC: conversational input

Re:conversational input 11 Nov 2011 04:57 #14766

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 4955
  • Thank you received: 87
  • Karma: 134
Do you have tabs for all of the subs in the gz or are some just subroutines? I'm setting up a sim to try them out.

Can you post your ngcgui section of your ini file?

Thanks for sharing.

John
The administrator has disabled public write access.

Re:conversational input 11 Nov 2011 10:06 #14773

  • dgarrett
  • dgarrett's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 27
  • Thank you received: 3
  • Karma: 32
Nice work!

Some notes:

1) With emc 2.4 (and later) you could use the built-in numbered parameter #5400 for the tool number and eliminate maintaining the global #<_Tool:Number>

2) The tool changing subroutine seems to be duplicated in several files. For emc2.5, you could have one changetool.ngc subroutine in a directory specified by the inifile path list:
[RS274NGC]SUBROUTINE_PATH

To prevent ngcgui confusing this type of "utility" subroutine with ngcgui-compatible subroutine, mark it with the special comment:
(not_a_subfile)

Example:
$ cat changetool.ngc
(not_a_subfile)
o<changetool> sub
#<ToolNumber>=#1
#<Coolant>=#2
O120 if [#5400 NE #<ToolNumber>]
... etc
O120 endif
o<changetool> endsub

3) The use of numbered parameters above #5000 might run into problems with emc built-in assignments in the future. Numbered parameters below #5000 are probably a better choice. More generally, local, named parameters offer less chance of conflict and are more readable too.

4) The use of global named parameters as inputs to ngcgui is deprecated and could become incompatible in the future. It is ok (and often necessary) to use global named parameters to return subroutine results. The only instances i noted are in start.ngc:

#<_Max:RPM> = #2 (=1400 Max Spindle RPM)
#<_Tool:Number> = #3 (=1 Tool Number)

could be remedied simply as:

#<maxrpm> = #2 (=1400 Max Spindle RPM)
#<tno> = #3 (=1 Tool Number)
...
#<_Max:RPM> = #<maxprm>
#<_Tool:Number> = #<tno>
The administrator has disabled public write access.

Re:conversational input 11 Nov 2011 11:11 #14774

  • BigJohnT
  • BigJohnT's Avatar
  • OFFLINE
  • Administrator
  • Posts: 4955
  • Thank you received: 87
  • Karma: 134
Dewey,

Thanks for the information. I love ngcgui, it is a real time saver on my lathe and plasma.

John
The administrator has disabled public write access.
Moderators: Rick G
Time to create page: 2.691 seconds
Powered by Kunena Forum
© 2013 LinuxCNC.org
Joomla! is Free Software released under the GNU General Public License.