Having issues with oword test scripts in version 2.9.4

More
06 Sep 2025 21:09 #334562 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

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

More
06 Sep 2025 21:23 - 06 Sep 2025 21:23 #334564 by Hakan
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
Last edit: 06 Sep 2025 21:23 by Hakan.

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

More
06 Sep 2025 21:23 #334565 by MaHa
I think there are square brackets required
#<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.

Time to create page: 0.055 seconds
Powered by Kunena Forum