use ini parameters in own subroutine

More
4 years 5 months ago #243912 by mgm
hello guys

I want to store some parameters in the ini and then use them in my subroutine.
I am doing something wrong!
I have entered the following in the ini:
[GCODE_MIRROW]
x = 2486.3

the subroutine is:
Code:
[code][code][code]o<tool_move> sub o100 if [EXISTS[#<_ini[gcode_mirrow]x>]]      (debug, #<_ini[gcode_mirrow]x>;) o100 else       (debug, not available)      o100 endif o<tool_move> endsub  m2 [code]When I now call the program I get not "x=10" but "not available". where is the problem? I try this in an axis sim 2.8.2  
[/code][/code][/code][/code]

Please Log in to join the conversation.

More
4 years 5 months ago #243914 by robertspark
oops:

linuxcnc.org/docs/2.9/html/gcode/overvie...gcode:ini-hal-params

its not case sensitive.

what about removing the semi-colon ";"
Code:
[/b]     (debug, #<_ini[gcode_mirrow]x>;)

Please Log in to join the conversation.

More
4 years 5 months ago #243918 by mgm
oh yes thanks I overlooked

have now added the following to the ini so that the :

INI_VARS = 1 Default 1 Allows G-code programs to read values from the INI file using the format #<_ini[section]name>.

unfortunately no success!

Please Log in to join the conversation.

More
4 years 5 months ago #243938 by roland
try a uppercase X in your ini.

btw: the closing round bracket is missing in your first debug line

Please Log in to join the conversation.

More
4 years 5 months ago #243941 by mgm
Thank you so much, you made my day!

The solution was perfect, within the ini you need a capital X.

Please Log in to join the conversation.

Time to create page: 0.086 seconds
Powered by Kunena Forum