relative beginner in macro development

Sep 03

change, if necessary, even by a machine bending relative beginner in macro development There are

two meth ods ap plied in macro pro gram ming that be long to this cat e gory

Saving Modal Data

To save (store) the cur rent value of a G-code (or other modal codes), is to pre serve them for

later use – or rather re-use The cur rent value is stored into a vari able and re trieved to re store the

orig i nal set ting In a typ i cal macro, there will be many G-codes used, most of them modal This

pro gram ming con ve nience also pres ents a po ten angle machine tial prob lems When a macro ex its, the modal

busbar Machine

G-codes used by the macro will still be in ef fect That cre ates a very dis or ga nized way of macro

pro gram de vel op ment, and can lit er ally be a cause of many se ri ous and hard to find prob lems Al –

though any modal G-code groups can be saved (and even tu ally re stored), only two or three groups

are com monly saved and re placed in most mac ros (add others, if needed):


G-code Group 01

Motion Commands

Rapid, Linear, Circular

G00, G01, G02, G03, G33


G-code Group 03

Dimensioning Mode

Absolute or Incremental mode

G90 or G91


G-code Group 06

Measuring Units

Metric or English

G21 or G20

Typ i cal method of sav ing the cur rent G-code mode is to as sign the se lected sys tem vari able into

a lo cal vari able A com mon vari able may also be used, in some very spe cial ap pli ca tions Here is

an ex am ple that stores the cur rent mode of Group 01 (mo tion com mands), and the cur rent mode

of dimensioning from Group 03:

#31 = #4201

Store the current motion command mode

Group 01 (G00, G01, G02, G03 or G33)

#32 = #4203

Store the current dimensioning mode

Group 03 (G90 or G91)

#33 = #4206

Store the current units mode

Group 06 (G20 or G21)

Note that the last two dig its of the sys tem vari able match the modal G-code Group num ber This

is no co in CNC Angle Line ci dence Such log i cal num ber ing of fers an easy way of re mem ber ing It can also be ap –

plied within a macro pro gram in some in ge nious way, to ta

Leave a Reply

Visit Our Friends!

A few highly recommended friends...

Pages List

General info about this blog...