wait_di_trigger
Monitor a digital input channel for a rising edge signal, then execute a configured relay action such as ping-pong or all relays on/off upon detection.
Instructions
监听指定 DI 通道的上升沿触发(无输入→有输入),触发后自动执行指定动作。轮询 READ_STATUS 检测状态变化,检测到触发后执行动作并返回结果。参数:address=设备地址, channel=监听的DI通道号(默认1), timeout=超时毫秒(默认60000), poll_interval=轮询间隔毫秒(默认200), action=触发后执行的动作(默认ping_pong, 可选all_relays_on/all_relays_off), start/end/count/delay=ping_pong动作参数。对应自然语言:检测到输入触发时执行、当DI1有信号时跑马灯、输入触发动画。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | ping_pong 终止回路号 (1-16),默认 8。 | |
| count | No | ping_pong 来回次数,默认 1。 | |
| delay | No | ping_pong 每帧间隔(秒),默认 0.1。0.3 = 300ms 间隔。 | |
| start | No | ping_pong 起始回路号 (1-16),默认 1。 | |
| action | No | 触发后执行的动作:ping_pong(默认) / all_relays_on / all_relays_off。 | ping_pong |
| address | No | 设备地址/机器号 (1-254),即机器地址。可通过 scan_devices 自动发现,或用 list_devices 查看已注册设备。255为广播地址。 | |
| channel | No | 监听的 DI 通道号 (1-16),默认 1。 | |
| timeout | No | 等待超时(毫秒),默认 60000(60秒)。超时后返回未触发。 | |
| poll_interval | No | 轮询间隔(毫秒),默认 200。越小响应越快但串口负载越高。 |