# Safety And Debug Checklist

Use this before answering tasks that can affect a live PLC, HMI, machine output, motion axis, heater, pump, valve, or communication write.

## High-Risk Trigger Words

If a user asks about any of these, include a safety precheck before procedural steps:

| Category | Trigger words / examples |
|---|---|
| Live program change | 在线下载, 下载用户程序, 保密下载, 上传, 写入配置, 用户配置写入 |
| Forced state | 强制, 强制输出, 强制 Y, 修改线圈, 双击线圈取反, 数据监控写值 |
| System/special devices | `SM030`, `SM032`, `SM034`, `SFD`, `FD`, `PFW`, 清保持区, 恢复出厂 |
| Motion/output energy | 伺服, 运动轴, 回零, 点动, 脉冲输出, 高速计数, 气缸, 电磁阀, 电机 |
| Process energy | 加热, PID, 泵, 阀, 压力, 温度, 变频器写频率 |
| Safety equipment | 急停, 安全门, 光幕, STO, 互锁, 防护门 |
| Communication write | Modbus 写, HMI 写寄存器, 配方下载到 PLC, 批量写寄存器 |

## Required Answer Shape For High-Risk Tasks

1. State the risk in one sentence.
2. Ask/confirm machine state: stopped, manual, maintenance, or running.
3. Confirm backup/current project and original register values where relevant.
4. Prefer monitor-only checks before writes/forces/downloads.
5. Give a controlled test sequence with an abort condition.
6. End with a restore/verification step.

## Before Live Changes

- Confirm the PLC model, firmware, XDPPro version, and whether the equipment is stopped, running, or in maintenance mode.
- Confirm the user has a current project backup and, when possible, an uploaded copy from the PLC.
- Confirm emergency stop, guards, hardwired interlocks, and safe torque off are functional before motion-related tests.
- Confirm the machine is clear of personnel, tools, and material before forcing outputs or running auto mode.
- Confirm whether the change affects outputs, motion, communication writes, PID/heating, retentive registers, or alarms.

## Download And Upload

- Normal download can stop or change the PLC program. Ask whether stopping the PLC is acceptable.
- Encrypted/secure download can prevent later upload. Warn clearly before recommending it.
- Online download changes a running program. Ask whether the machine can tolerate the change and whether the modified logic can cause unexpected outputs.
- If upload reports that the program does not exist, consider protected/encrypted download as a possible cause; do not suggest bypassing protection.

## Forced States And Register Writes

- Treat forcing coils, changing output-related bits, or writing registers as live machine actions.
- Ask for the soft-element purpose before recommending a value change.
- Prefer monitoring first, then controlled manual-mode test, then automatic sequence test.
- For retentive registers, record original values before changes.
- Do not recommend writing `SM030`, `SM032`, `SM034`, `SFD`, or `PFW` settings unless the model, purpose, stopped state, and recovery plan are clear.
- For HMI/Modbus recipe writes, confirm target register range and PLC-side range checks before writing production values.

## Commissioning Sequence

1. Review I/O mapping and terminal wiring.
2. Run syntax check and resolve error-list entries.
3. Verify input states in monitor mode.
4. Test outputs one at a time in a safe manual mode.
5. Test interlocks and permissives.
6. Test alarms and reset behavior.
7. Dry-run automatic sequence without product or load when possible.
8. Run controlled production test.
9. Save final project, exported parameter tables, and commissioning notes.

## Troubleshooting Order

1. Check PLC connection status and communication settings.
2. Check PLC本体信息, firmware, current project information, and error information.
3. Check scan cycle and module configuration when timing or module faults appear.
4. Use ladder/ST monitoring for logic state.
5. Use data monitoring or free monitoring for soft elements and registers.
6. Use oscilloscope monitoring for motion, analog, PID, or fast-changing register values.
7. Check HMI communication, variable addresses, and protocol settings.

## Boundaries

- Do not bypass passwords, crack protected programs, or defeat safety devices.
- Do not treat PLC software interlocks as a replacement for required hardware safety circuits.
- For legal or safety-standard compliance, tell the user to consult the machine builder, safety engineer, or applicable standards.
