- GCode and Part Programs
- O Codes (subroutines) and NGCGUI
- Having issues with oword test scripts in version 2.9.4
Having issues with oword test scripts in version 2.9.4
- scsmith1451
- 
				 Topic Author Topic Author
- Offline
- Senior Member
- 
				  
		Less
		More
		
			
	
		- Posts: 60
- Thank you received: 2
			
	
						06 Sep 2025 21:09				#334562
		by scsmith1451
	
	
		
			
	
			
			 		
													
	
				Having issues with oword test scripts in version 2.9.4 was created by scsmith1451			
			
				All;
I'm running LCNC 2.9.4 upgraded from a 2.9.3 disc image install.
I have this simple test script:
o<mytest2> sub
#<factor> = 1
o100 if [#<_metric>]
#<factor> = 25.4
o100 endif
#<value> = 30 * #<factor>
(LOGOPEN,mytest.txt)
(LOG, factor: #<factor>)
(LOG, value: #<value>)
(LOGCLOSE)
o<mytest2> endsub
in my nc_files directory. If I comment out the two lines with "value" in then the script runs fine in both sim.axis and sim.axis_mm profiles. When I uncomment the lines I get this output:
emc/task/emctask.cc 68: interp_error: Bad character '*' used
Bad character '*' used
According to the documentation "*" is the multiplication operator. Anyone else experiencing this issue? Is there a resolution?
The second issue is closely related.
I also have this test script:
o<mytest2> sub
#<factor> = 1
o100 if [#<_metric>]
#<factor> = 25.4
o100 endif
(LOGOPEN,mytest.txt)
(LOG, laser-offset-x: #<_ini[LASER]laser-offset-x>)
(LOG, laser-offset-y: #<_ini[LASER]laser-offset-y>)
(LOG, park-offset: #<_ini[PARK]park-offset>)
(LOG, z-offset: #<_ini[PROBE]z-offset>)
(LOGCLOSE)
o<mytest2> endsub
where I try to read ini parameters defined in the axis.ini and axis_mm.ini files as follows:
[LASER]
laser-offset-x = -3.1702
laser-offset-y = 0.0568
[PARK]
park-offset = 0.125
[PROBE]
z-offset = 0.543
When the script is executed the output looks like this:
LOGOPEN(mytest.txt) -> 0x55cc4c8cee20
LOG( laser-offset-x: ######)
LOG( laser-offset-y: ######)
LOG( park-offset: ######)
LOG( z-offset: ######)
LOGCLOSE()
Again, is anyone else experiencing this issue in 2.9.4? Is there a resolution?
Kind regards
					I'm running LCNC 2.9.4 upgraded from a 2.9.3 disc image install.
I have this simple test script:
o<mytest2> sub
#<factor> = 1
o100 if [#<_metric>]
#<factor> = 25.4
o100 endif
#<value> = 30 * #<factor>
(LOGOPEN,mytest.txt)
(LOG, factor: #<factor>)
(LOG, value: #<value>)
(LOGCLOSE)
o<mytest2> endsub
in my nc_files directory. If I comment out the two lines with "value" in then the script runs fine in both sim.axis and sim.axis_mm profiles. When I uncomment the lines I get this output:
emc/task/emctask.cc 68: interp_error: Bad character '*' used
Bad character '*' used
According to the documentation "*" is the multiplication operator. Anyone else experiencing this issue? Is there a resolution?
The second issue is closely related.
I also have this test script:
o<mytest2> sub
#<factor> = 1
o100 if [#<_metric>]
#<factor> = 25.4
o100 endif
(LOGOPEN,mytest.txt)
(LOG, laser-offset-x: #<_ini[LASER]laser-offset-x>)
(LOG, laser-offset-y: #<_ini[LASER]laser-offset-y>)
(LOG, park-offset: #<_ini[PARK]park-offset>)
(LOG, z-offset: #<_ini[PROBE]z-offset>)
(LOGCLOSE)
o<mytest2> endsub
where I try to read ini parameters defined in the axis.ini and axis_mm.ini files as follows:
[LASER]
laser-offset-x = -3.1702
laser-offset-y = 0.0568
[PARK]
park-offset = 0.125
[PROBE]
z-offset = 0.543
When the script is executed the output looks like this:
LOGOPEN(mytest.txt) -> 0x55cc4c8cee20
LOG( laser-offset-x: ######)
LOG( laser-offset-y: ######)
LOG( park-offset: ######)
LOG( z-offset: ######)
LOGCLOSE()
Again, is anyone else experiencing this issue in 2.9.4? Is there a resolution?
Kind regards
Please Log in or Create an account to join the conversation.
- Hakan
- Away
- Platinum Member
- 
				  
		Less
		More
		
			
	
		- Posts: 976
- Thank you received: 332
			
	
						06 Sep 2025 21:23		 -  06 Sep 2025 21:23		#334564
		by Hakan
	
	
		
			
	
	
			 		
													
	
				Replied by Hakan on topic Having issues with oword test scripts in version 2.9.4			
			
				There is a difference versus the doc linuxcnc.org/docs/html/gcode/o-code.html#ocode:subroutines
Use o100-style instead of o<mytest2>?
o100 sub
g-code
o100 endsub
					Use o100-style instead of o<mytest2>?
o100 sub
g-code
o100 endsub
		Last edit: 06 Sep 2025 21:23  by Hakan.			
			Please Log in or Create an account to join the conversation.
- MaHa
- Offline
- Platinum Member
- 
				  
		Less
		More
		
			
	
		- Posts: 464
- Thank you received: 196
			
	
						06 Sep 2025 21:23				#334565
		by MaHa
	
	
		
			
	
			
			 		
													
	
				Replied by MaHa on topic Having issues with oword test scripts in version 2.9.4			
			
				I think there are square brackets required
#<value> = [30 * #<factor>]
setting to read values from ini file
[RS274NGC]
INI_VARS = 1
					#<value> = [30 * #<factor>]
setting to read values from ini file
[RS274NGC]
INI_VARS = 1
Please Log in or Create an account to join the conversation.
- scsmith1451
- 
				 Topic Author Topic Author
- Offline
- Senior Member
- 
				  
		Less
		More
		
			
	
		- Posts: 60
- Thank you received: 2
			
	
						09 Sep 2025 11:34				#334683
		by scsmith1451
	
	
		
			
	
			
			 		
													
	
				Replied by scsmith1451 on topic Having issues with oword test scripts in version 2.9.4			
			
				Thanks MaHa,
The bracket syntax worked great, however, I'm still not able to access the INI vars after adding the INI_VARS = 1 to the ini file. Is there another setting that I'm missing?
					The bracket syntax worked great, however, I'm still not able to access the INI vars after adding the INI_VARS = 1 to the ini file. Is there another setting that I'm missing?
Please Log in or Create an account to join the conversation.
- MaHa
- Offline
- Platinum Member
- 
				  
		Less
		More
		
			
	
		- Posts: 464
- Thank you received: 196
			
	
						11 Sep 2025 18:38				#334838
		by MaHa
	
	
		
			
	
	
			 		
													
	
				Replied by MaHa on topic Having issues with oword test scripts in version 2.9.4			
			
				Just in case it's not solved yet:
Use capital letters for ini file entrys...
			
					Use capital letters for ini file entrys...
[LASER]
LASER-OFFSET-X = -3.1702
LASER-OFFSET-Y = 0.0568
[PARK]
PARK-OFFSET = 0.125
[PROBE]
Z-OFFSET = 0.543
		The following user(s) said Thank You: scsmith1451 	
			Please Log in or Create an account to join the conversation.
- GCode and Part Programs
- O Codes (subroutines) and NGCGUI
- Having issues with oword test scripts in version 2.9.4
		Time to create page: 0.170 seconds	
