Variable Modality and Set Status

Every GPP variable can be defined as modal or non-modal. In GPP2, the default modality is non-modal for all variables. The variable modality can be modified by statements in the GPP program declaration part.

Variables are typically defined as modal when they need to be output to the G-code file, but only if they are set on. The perfect example is X_CURPOS, which only needs to be output it is assigned a new value (and hence set on). With GPP2, only a few variables need to be defined as modal.

All Array members share the same modality, which is defined for the whole array.

The only difference between modal and non-modal variables is how they are affected by OUTPUT and PRINT commands. More specifically, the difference relates to their set status - that needs some explanation.

In GPP, each variable has a special status flag, signaling of the variable is set on or off. It is primarily used to identify system variables that are actually assigned new values by GPP when a block is processed. However, user-defined variables also have the same status set flag, and behave the same way.

In arrays, each array member has a separate set flag. Therefore, some array members may be on, while others may be off.

The set status flag can be tested in program control statements (such as IF, IF_SET and REPEAT UNTIL), so that different actions can be taken based on any variable status.

In GPP2, the set status flag dose not affect how variables are printed in OUTPUT & PRINT statements. A variable will be printed even if it is in set off status.

A variable is set on in one of the following cases:

A variable is turned off in one of the following cases:

Once again, the only difference between modal and non-modal variables is how they react to OUTPUT statements. Modal variables are turned off, while non-modal variables are not.

GPP Compatibility Notes:

In the old GPP manual, it is stated that non-modal variables are never turned off. This is not accurate - they are not turned off by the OUTPUT statement, but they can be turned off in other ways (For example, with the SET_OFF command).

In old GPP, members of modal arrays do not respond to the OUTPUT statement. They remain set on. In GPP2, they are turned "off", like any modal variable.

In old GPP, the default modality for each variable was taken from its format. In GPP2, formats do not have modality anymore, and all variables are non-modal by default, unless explicitly declared as modal.

Some functionality may be dependent on the product package. Contact your Reseller if you require a license.