Reading a Setting & Branching

Read a setting from the #20000 mirror and take a different path based on it.

The NGC mirrors the entire Settings page into read-only variables: #20000 + n is Setting n. #20009 is Setting 9, DIMENSIONING — the machine's unit mode. A macro can read it and adapt. Treat 0 as INCH and 1 as MM for this lesson (confirm the encoding on a real machine before you rely on it).

Read firstHaas Settings & ParametersReference for Haas NGC Settings and Parameters: the operator-tunable Settings page vs. the service-level Parameter layer, the settings a programmer actually touches (9, 22, 23, 27, 31, 33, 52, 58, 76, 88, 118), and reading them from macros via #20000+n.

Your turn

A clearance height of 1.0 inch is baked into your macro. Read Setting 9 from #20009 and leave the clearance in #101 in the machine's current units: keep it 1.0 in inch mode (#20009 = 0), or convert it to millimetres (× 25.4) in mm mode (#20009 = 1). Use an IF branch.

The machine gives you

inch mode (Setting 9 = 0):#20009 = 0
mm mode (Setting 9 = 1):#20009 = 1

Your program is run once for each set of conditions. It has to work for all of them.

Loading...

This is a learning simulation — always prove out a program on the actual control before you cut metal.