Import LinuxCNC source tree
This commit is contained in:
24
configs/sim/axis/vismach/millturn/mcodes/M128
Executable file
24
configs/sim/axis/vismach/millturn/mcodes/M128
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/tclsh
|
||||
# change axis limits to MILL limits
|
||||
set switchkins_pin 3 ;# agree with inifile
|
||||
set coords "x y z" ;# agree with inifile
|
||||
|
||||
package require Linuxcnc ;# must be before Hal
|
||||
emc_init -ini $::env(INI_FILE_NAME) -quick
|
||||
package require Hal
|
||||
parse_ini $::env(INI_FILE_NAME)
|
||||
|
||||
# Check if correct kinematic is active
|
||||
if {[hal getp kinstype.is-0] == "FALSE"} {
|
||||
puts "kinematic does not match! Are you calling M128 instead of M428?"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# RESTORE INI axis limits
|
||||
foreach l $coords {
|
||||
set L [string toupper $l]
|
||||
catch {hal setp ini.$l.min_limit [set ::AXIS_[set L](MIN_LIMIT)]}
|
||||
catch {hal setp ini.$l.max_limit [set ::AXIS_[set L](MAX_LIMIT)]}
|
||||
catch {hal setp ini.$l.min_velocity [set ::AXIS_[set L](MAX_VELOCITY)]}
|
||||
catch {hal setp ini.$l.max_acceleration [set ::AXIS_[set L](MAX_ACCELERATION)]}
|
||||
}
|
||||
24
configs/sim/axis/vismach/millturn/mcodes/M129
Executable file
24
configs/sim/axis/vismach/millturn/mcodes/M129
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/tclsh
|
||||
# change axis limits to TURN limits
|
||||
set switchkins_pin 3 ;# agree with inifile
|
||||
set coords "x y z" ;# axis declared must provide MIN_LIMIT_TURN and MAX_LIMIT_TURN in inifile
|
||||
|
||||
package require Linuxcnc ;# must be before Hal
|
||||
emc_init -ini $::env(INI_FILE_NAME) -quick
|
||||
package require Hal
|
||||
parse_ini $::env(INI_FILE_NAME)
|
||||
|
||||
# Check if correct kinematic is active
|
||||
if {[hal getp kinstype.is-1] == "FALSE"} {
|
||||
puts "kinematic does not match! Are you calling M129 instead of M429?"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# RESTORE INI axis limits
|
||||
foreach l $coords {
|
||||
set L [string toupper $l]
|
||||
catch {hal setp ini.$l.min_limit [set ::AXIS_[set L](MIN_LIMIT_TURN)]}
|
||||
catch {hal setp ini.$l.max_limit [set ::AXIS_[set L](MAX_LIMIT_TURN)]}
|
||||
catch {hal setp ini.$l.min_velocity [set ::AXIS_[set L](MAX_VELOCITY)]}
|
||||
catch {hal setp ini.$l.max_acceleration [set ::AXIS_[set L](MAX_ACCELERATION)]}
|
||||
}
|
||||
Reference in New Issue
Block a user