2.9.3 INI_VARS issue
- shipmodeller
- 
				 Topic Author Topic Author
- Offline
- Senior Member
- 
				  
		Less
		More
		
			
	
		- Posts: 55
- Thank you received: 3
			
	
						03 Jan 2025 22:36				#317976
		by shipmodeller
	
	
		
			
	
			
			 		
													
	
				2.9.3  INI_VARS issue was created by shipmodeller			
			
				Using the sims.ini file, I set up the following:
.
.
.
[RS274NGC]
INI_VARS = 1
[TOOLSETTER]
z_tool = -1
Z_TOOL_HOME = -0.1
X_TOOL_HOME = 0
Y_TOOL_HOME = -10.25
OK ... when I boot up the system, no errors are indicated. I "home" the system, and switch to the MDI box.
I then put in the following command:
G0 Z#<_ini[TOOLSETTER]z_tool>
It errors and says that the variable doesn't exist. Hmmm... so I tried doing ..
#<_ini[TOOLSETTER]z_tool> = -1.25
It took that without issue... I then executed
G0 Z#<_ini[TOOLSETTER]z_tool>
and now it works. hmmm.. What am I doing wrong? It is supposed to have a variable defined during ini time... but it isn't, at least that is what I am seeing.
It is appearing to allocate the variable AFTER ok, but not during the ini ... Please set me right.
 			
					.
.
.
[RS274NGC]
INI_VARS = 1
[TOOLSETTER]
z_tool = -1
Z_TOOL_HOME = -0.1
X_TOOL_HOME = 0
Y_TOOL_HOME = -10.25
OK ... when I boot up the system, no errors are indicated. I "home" the system, and switch to the MDI box.
I then put in the following command:
G0 Z#<_ini[TOOLSETTER]z_tool>
It errors and says that the variable doesn't exist. Hmmm... so I tried doing ..
#<_ini[TOOLSETTER]z_tool> = -1.25
It took that without issue... I then executed
G0 Z#<_ini[TOOLSETTER]z_tool>
and now it works. hmmm.. What am I doing wrong? It is supposed to have a variable defined during ini time... but it isn't, at least that is what I am seeing.
It is appearing to allocate the variable AFTER ok, but not during the ini ... Please set me right.
Please Log in or Create an account to join the conversation.
- shipmodeller
- 
				 Topic Author Topic Author
- Offline
- Senior Member
- 
				  
		Less
		More
		
			
	
		- Posts: 55
- Thank you received: 3
			
	
						04 Jan 2025 17:42		 -  04 Jan 2025 17:45		#318110
		by shipmodeller
	
	
		
			
	
	
			 		
													
	
				Replied by shipmodeller on topic 2.9.3  INI_VARS issue			
			
				1: After a lot of playing around, I think I found the flaws in my thinking.  First of all, the variables in the INI file MUST be capital.  So changing my file as below allowed me to use it as a READ ONLY variable.
[TOOLSETTER]
Z_TOOL = -1
Z_TOOL_HOME = -0.1
X_TOOL_HOME = 0
Y_TOOL_HOME = -10.25
2: You cannot CAN NOT use the ini variables as a regular read / write variable. Is this brought out in the documentation? I must have glossed over it .. see this: Nowhere in here does it state capital or read only state. I think that needs to be added to the manual.
3: So that begs another question... is there any script that can be configured to run on initialization of LinuxCNC so we can create variables and set them to certain values? I don't remember reading anything like that in the manual. It would be nice if the ini section had an entry for that.I can't really mark this solved, because of the remarks I made here. Yes, I have a better understanding now.. IF I am correct in my assumptions. But it has led to some confusion, and days wasted troubleshooting this. ( I have been programming since 1967, long retired now. )
[/code][/code][/b][/b][/b]			
					[TOOLSETTER]
Z_TOOL = -1
Z_TOOL_HOME = -0.1
X_TOOL_HOME = 0
Y_TOOL_HOME = -10.25
2: You cannot CAN NOT use the ini variables as a regular read / write variable. Is this brought out in the documentation? I must have glossed over it .. see this: Nowhere in here does it state capital or read only state. I think that needs to be added to the manual.
3: So that begs another question... is there any script that can be configured to run on initialization of LinuxCNC so we can create variables and set them to certain values? I don't remember reading anything like that in the manual. It would be nice if the ini section had an entry for that.I can't really mark this solved, because of the remarks I made here. Yes, I have a better understanding now.. IF I am correct in my assumptions. But it has led to some confusion, and days wasted troubleshooting this. ( I have been programming since 1967, long retired now. )
[code][b][b][b][code][b][color=#3498db]Thanks for reading this.
 [/color][/b]
		Last edit: 04 Jan 2025 17:45  by shipmodeller.			
			Please Log in or Create an account to join the conversation.
- shipmodeller
- 
				 Topic Author Topic Author
- Offline
- Senior Member
- 
				  
		Less
		More
		
			
	
		- Posts: 55
- Thank you received: 3
			
	
						05 Jan 2025 23:17				#318180
		by shipmodeller
	
	
		
			
	
			
			 		
													
	
				Replied by shipmodeller on topic 2.9.3  INI_VARS issue			
			
				So I confirmed that all declared ini variables are READ_ONLY
file: src/emc/rs274ngc/interp_namedparams.cc
param.attr = PA_GLOBAL | PA_READONLY | PA_FROM_INI;
Documentation should make that clear.
					file: src/emc/rs274ngc/interp_namedparams.cc
param.attr = PA_GLOBAL | PA_READONLY | PA_FROM_INI;
Documentation should make that clear.
Please Log in or Create an account to join the conversation.
- Aciera
- 
				  
- Offline
- Administrator
- 
				  
		Less
		More
		
			
	
		- Posts: 4554
- Thank you received: 2028
			
	
						06 Jan 2025 08:06				#318202
		by Aciera
	
	
		
			
	
	
		
	
			 		
													
	
				Replied by Aciera on topic 2.9.3  INI_VARS issue			
			
				Looks like this is already documented, see  section 4:
linuxcnc.org/docs/stable/html/gcode/over...gcode:ini-hal-params
 
			
					linuxcnc.org/docs/stable/html/gcode/over...gcode:ini-hal-params
Attachments:
		The following user(s) said Thank You: shipmodeller 	
			Please Log in or Create an account to join the conversation.
- JT
- 
				  
- Away
- Administrator
- 
				  
		Less
		More
		
			
	
		- Posts: 1032
- Thank you received: 536
			
	
						06 Jan 2025 14:09				#318225
		by JT
	
	
		
			
				
gnipsel.com/linuxcnc/flexgui/hal.html#spinbox
or you can set user numbered parameters from the GUI and use them in your NC code
gnipsel.com/linuxcnc/flexgui/parameters.html
JT
 			
					
	
	
			 		
													
	
				Replied by JT on topic 2.9.3  INI_VARS issue			
			In Flex GUI you can have spin boxes to set hal values3: So that begs another question... is there any script that can be configured to run on initialization of LinuxCNC so we can create variables and set them to certain values? I don't remember reading anything like that in the manual. It would be nice if the ini section had an entry for that.I can't really mark this solved, because of the remarks I made here. Yes, I have a better understanding now.. IF I am correct in my assumptions. But it has led to some confusion, and days wasted troubleshooting this. ( I have been programming since 1967, long retired now. )
[/code][/code][/b][/b][/b][code][b][b][b][code][b][color=#3498db]Thanks for reading this. [/color][/b]
gnipsel.com/linuxcnc/flexgui/hal.html#spinbox
or you can set user numbered parameters from the GUI and use them in your NC code
gnipsel.com/linuxcnc/flexgui/parameters.html
JT
		The following user(s) said Thank You: shipmodeller 	
			Please Log in or Create an account to join the conversation.
- shipmodeller
- 
				 Topic Author Topic Author
- Offline
- Senior Member
- 
				  
		Less
		More
		
			
	
		- Posts: 55
- Thank you received: 3
			
	
						06 Jan 2025 16:41				#318239
		by shipmodeller
	
	
		
			
	
			
			 		
													
	
				Replied by shipmodeller on topic 2.9.3  INI_VARS issue			
			
				Thanks for that answer...  however... it still is unanswered in my original post I did this:
"G0 Z#<_ini[TOOLSETTER]z_tool>
It errors and says that the variable doesn't exist. Hmmm... so I tried doing ..
#<_ini[TOOLSETTER]z_tool> = -1.25
It took that without issue... I then executed
G0 Z#<_ini[TOOLSETTER]z_tool>
and now it works. hmmm.. What am I doing wrong? It is supposed to have a variable defined during ini time... but it isn't, at least that is what I am seeing."
So, it is ok to generate a variable of the form _ini[TOOLSETTER]z_tool ? That started my path down this thread. If all _ini variables are READ ONLY, then why did it all me creating and setting the variable like I did in the first example? It should have errored out and give me some message like "ini variables cannot be dynamically declared" or something like that.
I thank you for finding the documentation on the proper usage of the ini variables..
 			
					"G0 Z#<_ini[TOOLSETTER]z_tool>
It errors and says that the variable doesn't exist. Hmmm... so I tried doing ..
#<_ini[TOOLSETTER]z_tool> = -1.25
It took that without issue... I then executed
G0 Z#<_ini[TOOLSETTER]z_tool>
and now it works. hmmm.. What am I doing wrong? It is supposed to have a variable defined during ini time... but it isn't, at least that is what I am seeing."
So, it is ok to generate a variable of the form _ini[TOOLSETTER]z_tool ? That started my path down this thread. If all _ini variables are READ ONLY, then why did it all me creating and setting the variable like I did in the first example? It should have errored out and give me some message like "ini variables cannot be dynamically declared" or something like that.
I thank you for finding the documentation on the proper usage of the ini variables..
Please Log in or Create an account to join the conversation.
- Aciera
- 
				  
- Offline
- Administrator
- 
				  
		Less
		More
		
			
	
		- Posts: 4554
- Thank you received: 2028
			
	
						06 Jan 2025 19:20		 -  06 Jan 2025 19:28		#318251
		by Aciera
	
	
		
			
	
	
		
	
			 		
													
	
				Replied by Aciera on topic 2.9.3  INI_VARS issue			
			
					Attachments:
		Last edit: 06 Jan 2025 19:28  by Aciera.			
			Please Log in or Create an account to join the conversation.
- shipmodeller
- 
				 Topic Author Topic Author
- Offline
- Senior Member
- 
				  
		Less
		More
		
			
	
		- Posts: 55
- Thank you received: 3
			
	
						06 Jan 2025 19:28				#318252
		by shipmodeller
	
	
		
			
	
			
			 		
													
	
				Replied by shipmodeller on topic 2.9.3  INI_VARS issue			
			
				I repeated these issues with both the axis.ini setup for sim, and MY_MILL.ini.  interesting.  2.9.3 LinuxCNC distribution, no mods. total install of ISO			
					Please Log in or Create an account to join the conversation.
- Aciera
- 
				  
- Offline
- Administrator
- 
				  
		Less
		More
		
			
	
		- Posts: 4554
- Thank you received: 2028
			
	
						06 Jan 2025 19:32				#318253
		by Aciera
	
	
		
			
	
	
		
			
			 		
													
	
				Replied by Aciera on topic 2.9.3  INI_VARS issue			
			
					Attachments:
Please Log in or Create an account to join the conversation.
- shipmodeller
- 
				 Topic Author Topic Author
- Offline
- Senior Member
- 
				  
		Less
		More
		
			
	
		- Posts: 55
- Thank you received: 3
			
	
						06 Jan 2025 19:48				#318254
		by shipmodeller
	
	
		
			
	
			
			 		
													
	
				Replied by shipmodeller on topic 2.9.3  INI_VARS issue			
			
				Thanks... I'll try the same thing yet again, and post my results			
					Please Log in or Create an account to join the conversation.
		Time to create page: 0.115 seconds	
 
													 
	 
	