First-scan setup
Load starting values once, then let the program change them.
Step by step
Pick a step. The rungs are drawn by the editor after Core scans the program up to that step.
Global.System_Scan_FirstXIC
Source
Dest500
Global.RaisePBXIC
ONS
ADD
AGlobal.Setpoint500B10DestGlobal.Setpoint500
1. First scan. System_Scan_First is 1, so the MOV loads 500 into Setpoint.
Global.System_Scan_FirstXIC
Source
Dest500
Global.RaisePBXIC
ONS
ADD
AGlobal.Setpoint500B10DestGlobal.Setpoint500
2. Scan 2. System_Scan_First is 0 from now on. The MOV does not run again.
Global.System_Scan_FirstXIC
Source
Dest510
Global.RaisePBXIC
ONS
ADD
AGlobal.Setpoint510B10DestGlobal.Setpoint510
3. Press RaisePB. The ONS passes once and ADD raises Setpoint to 510.
Global.System_Scan_FirstXIC
Source
Dest510
Global.RaisePBXIC
ONS
ADD
AGlobal.Setpoint510B10DestGlobal.Setpoint510
4. Release RaisePB. Setpoint stays at 510. Nothing writes 500 again.
| Step | System_Scan_First | RaisePB | Setpoint |
|---|---|---|---|
| 1. First scan | 1 | 0 | 500 |
| 2. Scan 2 | 0 | 0 | 500 |
| 3. Press RaisePB | 0 | 1 | 510 |
| 4. Release RaisePB | 0 | 0 | 510 |
Why it works
- The engine sets System_Scan_First to 1 on the first scan after a reset or a project load, and to 0 on every scan after.
- The MOV runs only on that scan, so later changes to Setpoint are kept.
Common mistakes
- Writing a default every scanWithout System_Scan_First, the MOV puts 500 back every scan and RaisePB seems to do nothing.