[Home]EmcConfTickle

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

#!/bin/sh
# the next line restarts using wish \ 
exec wish "$0" "$@"

# Tcl/Tk configuration utility for the Enhanced Machine Controller.
# Place GPL copyright info here copyright 2005 linuxcnc.org 

I borrowed this code from Paul's example at EmcConfig. I'll look at how a tickle config program can use it to extract valuable information. Notice that Paul is following the logical divisions of the INI. Variables in the ini are not all at the same level even though they appear to be flat. His example where the choice of value of a single variable EMCMOT = xxx will lead to many different sets of variables and possible values (ranges of values) for them.

<ini_section>EMCMOT
<parm_parm>
<parm_option> module</parm_option>
<parm_option>IO_BASE_ADDRESS</parm_option>
<parm_help_i18> ????
</ini_parm>
</ini_section>

<ini_parm_module>freqmod
<description "Basic stepper motor control"/>
<motor_type>stepper</motor_type>
<parms_needed>PERIOD</parms_needed>
<parms_needed>STEPPING_TYPE</parms_needed>
<parms_needed>HOLD_TIME</parms_needed>
<max_axis 6/>
</ini_parm_module>

<ini_parm_module>smdromod
<description "Stepper motor control with encoder feedback using the Kaluga DRO card"/>
<motor_type>stepper</motor_type>
<parms_needed>PERIOD</parms_needed>
<parms_needed>STEPPING_TYPE</parms_needed>
<parms_needed>HOLD_TIME</parms_needed>
<parms_needed>DRO_BASE_ADDRESS</parms_needed>
<parms_needed>INPUT_SCALE</parms_needed>
<max_axis 8/>
</ini_parm_module>

<ini_parm_module>Foomod
<description "Mixed mode control with custom PCI card"/>
<motor_type>stepper+servo</motor_type>
<parms_needed>INPUT_SCALE</parms_needed>
<parm_option_not_required>IO_BASE_ADDRESS</parm_option_not_required>
<max_axis=4/>
<provides_DIO_in=128/>
<provides_DIO_out=76/>
<provides_AIO_out=8/>
</ini_parm_module>

A search for the string <ini_parm_module> Will get you to the locations of these kinds of things in the data file. I would need to know, outside of the structure itself that the next word is the module name. I'd prefer a <name>Foomod</name> because I can search out these kinds of hooks and know what to do with them without requiring that they always be there.

It would also be possible to make name an attribute of the module tag. <ini_parm_module name=Foomod> would be fine if I know enough to look for attributes. I could even live with something like

   <ini_parm_module      
      name=Foomod
      motor=steppers>

The down side of this sort of arrangement is that we must know, outside of the file itself that the motor type is listed within the <ini_parm as an attribute. This may raise the motor variable to greater importance than it ought to have. It would seem to me to use attributes for the common to all tags sorts of things.


LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited February 27, 2005 8:00 pm by Rayhenry (diff)
Search:
Published under a Creative Commons License