Generating alarms for dangerous situations
Custom macro B allows a programmer to place the machine in an alarm condition using system variable #3000. Consider this command.
#3000 = 100 (OFFSET TOO BIG)
If the machine executes this command, it will go into alarm state and place this message on the display screen.
MC100 OFFSET TOO BIG
The alarm number corresponds to the number next to #3000, and for most control models, must range between 100 and 255.
In addition to being able to generate alarms, a CNC programmer also has access to lots of CNC functions that may be involved with incorrect settings. The values of all offset registers, current axis positions, and current modal states (G code values and the most recent values of many other letter addresses like H, R, D, T, etc.) are among the many things that can be tested within custom macros.
Having this ability to generate alarms has some great implications. We can use it to error trap lots of dangerous situations. Think of times when operators have had crashes on your machines in order to come up with some situations you may be able to error trap.
Has someone incorrectly entered offset values when making sizing adjustments, possibly typing 0.1 instead of 0.01? Has someone ever incorrectly entered a tool length compensation or fixture offset value? Has someone started a cycle with the axes out of position?
Say a machine must be at its zero return position when the program is executed. If it is not, something bad will happen. Consider these commands:
O0001 (Program number)
IF [#5021 EQ 0] GOTO 5
#3000 = 101 (X NOT HOME)
N5 IF [#5022 EQ 0] GOTO 10
#3000 = 102 (Y NOT HOME)
N10 IF [#5023 EQ 0] GOTO 15
#3000 = 103 (X NOT HOME)
N15. . .
System variables #5021, #5022, and #5023 monitor current position relative to the zero return position in the X, Y, and Z axes respectively. If one is not zero, the machine is not at the zero return position in that axis.
Again, think of times when a machine has crashed. If a mistake caused the crash, it is likely that you can error trap it using these techniques so it will not happen again. With a little ingenuity, just about any mistake can be error trapped.