01 Control mode flags
When a PLC and HMI or touchscreen form a monitoring system, screens often need mutually exclusive control modes such as "Manual" and "Auto". Implement this in the program by writing a constant into a register with a MOV instruction. For example, write 1 into register VB10 for Manual and 2 into VB10 for Auto. The system mode is determined by checking the register value. This approach is easy to understand and avoids complex interlock logic.
02 Analog signal filtering
For analog control, if the measured values have little noise, use time-based filtering such as a short delay. If measurements have large errors, use other filtering methods like averaging. Refer to standard literature for appropriate algorithms.
03 Debugging scan and jump issues
During program debugging, especially when integrating a new program into an existing machine, if a condition is met but the output coil does not energize, check whether the code lies within skipped sections such as JUMP or goto statements. Another possibility is that the code is not being scanned due to interrupts or scan sequencing.
04 Sequential control using +10 increments
For sequential control where one action leads to the next, the +10 step method is convenient. Preset a register to 0 at initialization. On system start, add 10 so the register equals 10; when the register equals 10 perform the first action. After the action completes, add 10 again to get 20, triggering the second action, and so on. To insert an action later, use the unused values within the 10-step gap. Using +10 instead of +1 provides room for insertion between steps.
05 Latch process faults and alarm
For process faults that are not caused by the control system, latch the fault condition and provide visual and audible alarms until an operator resets them. This ensures operators know a process fault occurred and prevents misattribution to the control program. Consider this during new system design.
06 Reusable submodules
Make frequently called routines into submodules for repeated use.
07 Overcycle protection with timers
Machine step motions have expected durations and limits. When a monitored step starts, start a timer set to 20%–30% longer than the normal duration. The timer output can trigger an alarm or automatic stop. If a step exceeds the preset timer and the machine has not advanced to the next step, the timer issues a fault signal to stop the normal cycle and start the alarm or shutdown routine. This is overcycle protection.
08 Use NC inputs for safety devices
Connect safety detection devices such as emergency stop buttons, safety light curtains, and limit switches as normally closed (NC) inputs.
09 Outputs active only when needed
For safety and energy efficiency, design outputs to be active only while an action is required and stop once the action reaches position. Avoid designs where outputs are continuously on and only turned off when stopping is necessary.
10 Actuator behavior principle
An actuator should prefer to remain stationary rather than move unpredictably.
11 Local/manual and automatic switching
Single-machine control must provide a local/manual and auto switch and allow start/stop in manual. When switching from auto to manual, the machine should not stop. When switching from manual to auto, start/stop behavior should be determined by the automatic program.
12 Rotation and runtime tracking for continuous machines
Single machines such as pumps and fans that run 24 hours should be rotated and have cumulative runtime tracking, unless start/stop sequencing is managed by the HMI. Operators may set rotations where applicable.