top of page

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.



49 views0 comments

Recent Posts

See All

Watch Out For That Tailstock Center!

Many turning centers, commonly called universal style turning centers, have the ability to do chucking work, bar work, and shaft work. These machines have horizontal spindles, meaning the workpiece is

The safe approach procedure

As you know, CNC machines have extremely fast motion rates. When you're verifying a program (new or proven programs), you also know that each tool will rapid to within a very small distance (usually 0

The right way to activate a program in production

Setup people who get a machine ready to run production know that just about anything can happen the first time they execute a program. If certain control panel functions are not properly set, the mach

bottom of page