|
||
|
|
|
图 1 交通路口示意图 |
|
图 2 各段时间分配 |
|
| |||||||||||||||||||||||||
|
|
| ||||||||||||||||||||||||
图 3 硬件接线图 |
|
表 1 输入 / 输出端口分配 |
LD M8002 |
OUT T0 |
OUT Y0 |
OUT T3 |
OUT C0 |
OUT Y3 |
SET S0 |
K300 |
OUT T2 |
K150 |
K5 |
RST C0 |
STL S0 |
LD T0 |
K50 |
LD T3 |
OUT T5 |
OUT T6 |
OUT Y2 |
SET S22 |
STL S30 |
SET S32 |
K5 |
K50 |
OUT Y3 |
STL S22 |
OUT Y3 |
STL S32 |
LD C0 |
STL S23 |
LD X0 |
OUT Y1 |
LD T2 |
OUT T4 |
AND T5 |
STL S34 |
OR X1 |
OUT T1 |
SET S31 |
K5 |
SET S34 |
LD T6 |
SET S20 |
K100 |
STL S31 |
LD T4 |
LDI C0 |
OUT S0 |
SET S30 |
LD T1 |
OUT Y4 |
SET S33 |
AND T5 |
RET |
STL S20 |
SET S23 |
K150 |
STL S33 |
OUT S32 |
END |
OUT Y2 |
STL S23 |
LD T3 |
OUT Y4 |
STL S34 |
|