When posting a program through Post Builder an axis needs to be output with a D word. During simulation, though, the axis word needs to be changed to a C . Though this can be changed in the Machine Configurator this utility is not available. How can this word be changed depending on whether the file is posted or simulated?
Solution
Add a Custom Command with the following code to the Start of Program event.
global mom_post_in_simulation
global mom_sys_leader
if { $mom_post_in_simulation == "CSE" } {
set mom_sys_leader(fifth_axis) "C"
} elseif { $mom_post_in_simulation == "0" } {
set mom_sys_leader(fifth_axis) "D"
}
Notes
Please be aware that any code provided by GTAC is intended to be used for example purposes only. It is the user's responsibility to determine whether the code is suitable for the intended purpose.