Definitions and constants in GPC
Use define declarations and built-in identifier constants without confusing textual names with runtime variables.
Overview
Definitions give readable names to values used throughout a script. They are compile-time declarations, not mutable runtime storage.
Controller identifiers and other built-in constants depend on the target and current Zen Studio documentation. Prefer official names over unexplained numeric literals.
Key facts
- define declarations appear before runtime blocks.
- A definition cannot be changed while the script runs.
- Built-in identifier availability can vary by target and software version.
GPC syntax examples
Examples are intentionally small. Replace identifiers only with values documented for your target.
define PRESS_POINT = 80;
main {
if (get_val(XB1_A) > PRESS_POINT) {
// threshold reached
}
}Functions, commands, and terms
Names below are catalog entries, not guessed signatures. Open the official sources for current parameter and return-value details.
definedeclarationAssociates a compile-time name with a value.
TRUEconstant familyBuilt-in truth value used by conditional expressions.
FALSEconstant familyBuilt-in false value used by conditional expressions.
PVAR_*constant familyIdentifiers for global persistent-variable positions.
SPVAR_*constant familyIdentifiers for slot-private persistent-variable positions.
Common mistakes
Trying to assign to a define name.
Using an undocumented numeric controller ID.
Assuming every legacy identifier exists on current Zen firmware.
Official GPC sources
Use these first-party references to confirm exact syntax and runtime behavior for your installed firmware and Studio version.
Related GPC references
Understand signed 16-bit runtime values, global storage, local scope, initialization, and safe array indexing.
Input and outputController input and output functionsRead current, physical, and prior values; detect transitions; write outputs; and understand when script changes affect later reads.
StatePersistent variables: PVAR and SPVARStore bounded settings in Zen global or slot-private persistent memory and load safe defaults.