use ini parameters in own subroutine

More
26 May 2022 15:55 - 27 May 2022 06:08 #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]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]
Attachments:
Last edit: 27 May 2022 06:08 by mgm.

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

More
26 May 2022 15:57 - 26 May 2022 16:04 #243914 by robertspark
Replied by robertspark on topic use ini parameters in own subroutine
oops:

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

its not case sensitive.

what about removing the semi-colon ";"
[/b]     (debug, #<_ini[gcode_mirrow]x>;)
Last edit: 26 May 2022 16:04 by robertspark.

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

More
26 May 2022 16:15 #243918 by mgm
Replied by mgm on topic use ini parameters in own subroutine
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 or Create an account to join the conversation.

More
26 May 2022 19:13 #243938 by roland
Replied by roland on topic use ini parameters in own subroutine
try a uppercase X in your ini.

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

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

More
26 May 2022 19:32 #243941 by mgm
Replied by mgm on topic use ini parameters in own subroutine
Thank you so much, you made my day!

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

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

Time to create page: 0.064 seconds
Powered by Kunena Forum