Run behavior during loading of job file and simulation
Simulation is the software mode when there is no hardware connected. During the loading of a G-Code file, the file is run by the interpreter while generating output for the graphic. During this no actions to the machine are applied, no motion and no IO, only checks if the g-code is valid and stays within the machine limits. If there is advanced macro programming, e.g. because the machine has automatic tool change, there it is important to take into account that in simulation and render mode no machine actions take place.
Check example that should be always executed
Suppose we have a machine with a 6-tool automatic tool changer. A check is programmed that generates an error if a g-code file is loaded that tries to change the tool to a number that the machine does not have:
It stands to reason that we want this “ErrMsg …” line to be executed always, when running but also in simulation mode and when loading the file.
Check example that should be only executed during the job
This check on air pressure will not work correctly while loading a g-code file or while the system is in simulation mode, because no actual inputs are read.
Here we see the modification to make the on the air pressure sensor input 5 simulation and render proof, the check is only performed when we are not in render or simulation mode, only an extra if statement that checks variable #5380 (contains the value of 1 when simulation mode) and #5397 (contains the value of 1 when rendering) is added.