Perhaps I will clarify if I point directly to the exact file I'm attempting to rectify: https://github.com/the-snowwhite/Hm2-soc_FDM/blob/work/Cramps/PY/OX/cramps.py#L91
I'm trying to replace the hard coded 12000 below with the parameter MAXRPM from the .ini file <https://github.com/the-snowwhite/Hm2-soc_FDM/blob/work/Cramps/PY/OX/ox.ini#L382> os.system('halcmd setp hm2_5i25.0.pwmgen.00.scale 12000') I cannot see how to make this work: os.system('halcmd setp hm2_5i25.0.pwmgen.00.scale c.find('SPINDLE', 'MAXRPM' )') On Tuesday, May 19, 2020 at 5:05:42 PM UTC+2, Bas de Bruijn wrote: > > > > > > *From:* [email protected] <javascript:> <[email protected] > <javascript:>> *On Behalf Of *justin White > *Sent:* Tuesday, 19 May 2020 17:01 > *To:* Machinekit <[email protected] <javascript:>> > *Subject:* Re: [Machinekit] Re: halcmd setp equivalent in python > > > > > > Yeah, I forgot Machinekit is in a perpetual state of "this might work the > way it used to".....or "maybe not". I've recompiled components to swap > parameters for pins but I don't think I'd try with a hm2 driver. > > > > If all you want to do is set a parameter from an .ini line you don't have > to do anything with Python whatsoever (unless there's some reason you > really want to). All you need to do is: > > > > In the .ini > > > > [SPINDLE] > > MAXRPM = 12000 > > > > In the hal file: > > setp hm2_5i25.0.pwmgen.00.scale [SPINDLE]MAXRPM > > > > That's the pretty standard usage, or am I missing something? > > > > > > > > Yes, we were talking of doing this from python (see subject) > -- website: http://www.machinekit.io blog: http://blog.machinekit.io github: https://github.com/machinekit --- You received this message because you are subscribed to the Google Groups "Machinekit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/machinekit/e107d5c8-ef00-4863-ad01-a66638c15562%40googlegroups.com.
