Skip to content

master: tclsh script accessing ini file triggers error message in terminal #4203

Description

@Sigma1912

I have a number of mcodes that access the inifile using tclsh like this example:

#!/usr/bin/tclsh

package require Linuxcnc ;# must be before Hal
emc_init -quick
package require Hal
parse_ini $::env(INI_FILE_NAME)

# Check if correct kinematic is active
if {[hal getp encdisconnect.c.mode-is-rotary] == "FALSE"} {
   puts "mode does not match! Are you calling M120 instead of M420?"
   exit 1
}

# Set rotary parameters
hal setp   hm2_7i95.0.stepgen.04.dirsetup        [set ::JOINT_2(DIRSETUP)]
hal setp   hm2_7i95.0.stepgen.04.dirhold         [set ::JOINT_2(DIRHOLD)]
hal setp   hm2_7i95.0.stepgen.04.steplen         [set ::JOINT_2(STEPLEN)]
hal setp   hm2_7i95.0.stepgen.04.stepspace       [set ::JOINT_2(STEPSPACE)]
hal setp   hm2_7i95.0.stepgen.04.position-scale  [set ::JOINT_2(SCALE)]
hal setp   hm2_7i95.0.stepgen.04.step_type       0
hal setp   hm2_7i95.0.stepgen.04.control-type    1
hal setp   hm2_7i95.0.stepgen.04.maxaccel        [set ::JOINT_2(STEPGEN_MAX_ACC)]
hal setp   hm2_7i95.0.stepgen.04.maxvel          [set ::JOINT_2(STEPGEN_MAX_VEL)]

Execution of these mcodes on current master produces this error:

emc.ini: error: Cannot open ini-file (errno=2 (No such file or directory))

@BsAtHome You might have an idea as this is related to ini file parsing.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions