What Your Code Owns
A package ships to every machine of its kind and is updated after those machines are running. Your logic sits beside it in the same project and no update touches it. That holds while both halves stay on their own side of one line.
A package knows a condition. It does not know a mechanism.
A condition is true of any machine of this kind: the operator wants 80% feed, the tool is clamped, the guards are shut, the spindle is running. A mechanism is how your machine makes that true: which terminal, which valve, how many bits, how long the contact bounces.
The line runs through a capability, not around it
Section titled “The line runs through a capability, not around it”Tool change is the worked example:
Four tests for a decision you are about to write
Section titled “Four tests for a decision you are about to write”A decision belongs on your side when it does any of this:
| The decision | Why it is yours |
|---|---|
| reads a raw input and decides what it means | decoding, debouncing, edge shaping, or combining several signals into one meaning |
| assumes a topology or a device count | so many bits, one-hot, this many valves, a fixed polarity, this sensor exists |
| holds a time that is a mechanical property | a settle dwell, a brake engage time, a pump run-on, a line priming delay |
| names a device | a drive model, an I/O card, a terminal, a sensor part number |
A protocol timeout against a stated heartbeat is not a mechanical property, and stays with the code that speaks the protocol.
The surfaces the two halves meet on
Section titled “The surfaces the two halves meet on”Wherever a machine could need to insert itself, a package publishes a fact and consumes a fact rather than finishing the job inside itself. Those facts are the surfaces:
| Direction | Surface | What it carries |
|---|---|---|
| you write | GVL_Config | this machine’s structural values, written before any package program runs |
| you write | GVL_Machine | the conditions the packages gate on: clamped, guards shut, door shut, subsystem busy, M code claimed |
| you write | GVL_Machine.CoolantLevelLow, .ProbeOvertravel, .AirPressureLow | trouble the packages annunciate, named so that publishing nothing means nothing to report |
| you write | GVL_Machine.ToolPresent, .WorkpiecePresent | annunciation only, so the panel can show them on any machine |
| you write | GVL_Io | the panel buttons and the handwheel count, mapped by your own PRG_IoMapping |
| you write | GVL_Channel.FeedOverride, GVL_Axes.Mpg* | what the operator asked for, from the panel |
| you write | GVL_Machine.SpindleOriented | drive-confirmed orient, read while GVL_Spindle.OrientConfirmEnabled |
| you declare | ST_PeripheralReader | a scanner or a serial device on the control’s port. The control opens it while Connect is TRUE and delivers each reading to Text; what the reading means is yours. See External Program Selection |
| you call | MC_ProgramSelect | the program this machine wants selected, by name. How it learned the name is yours; Done means the kernel loaded it |
| you read | GVL_Spindle.Running, .DirCwCmd, .DirCcwCmd, .CommandedRpm | the drive-neutral spindle command. Wires, telegrams and analog scale are yours |
| you read | GVL_Coolant.CoolantFloodOn, .CoolantMistOn | what the program asked for. Valves, pumps and priming are yours |
A sensor that is not wired yet is still your side
Section titled “A sensor that is not wired yet is still your side”An unwired input reads whatever the terminal floats at, and a machine is not finished all at once. So the flag that says what is connected is yours, folded into the fact you publish, and the package cannot tell the difference:
GVL_Machine.GuardsClosed := GVL_PhyIo.Phy_DI_GuardClosed OR NOT GVL_MachineConfig.GuardInterlockEnabled;Machine configuration and IO mapping, the two starting files CNC Core hands over, are where
those flags and these lines live. Keeping the flag on your side is also what lets you have one
for a sensor no package ever imagined.
What a package will not do
Section titled “What a package will not do”It will not read your terminals, name your devices, or hold your timings. A capability that looks half-finished from the outside is the seam: the package carries the part that is true of every machine of this kind, and stops where yours begins.
Where to go next
Section titled “Where to go next”- Modules: the starting files, and what happens to them when a package moves on.
- PLC: how logic reaches motion.
- HMI Project: the screens bound to these same variables.