发表于:2010/5/29 10:24:37
#0楼
为什么有此程序一定要用辅助继电器M,而不能够用输出继电器Y,比如以下 程序。
灯y0红、橙、黄、绿、青、蓝、紫y1~y7
ld m8000 y0(主题灯亮)
ld m8002
or m0
orp t6
ani t0
out m0(红灯亮)
out t0 k5
ldp t0
or m1
ani t1
out m1(橙灯亮)
out t1 k5
ldp t1
or m2
ani t2
out m2(黄灯亮)
out t2 k5
ldp t2
or m3
ani t3
out m3(绿灯亮)
out t3 k5
ldp t3
or m4
ani t4
out m4(青灯亮)
out t4 k5
ldp t4
or m5
ani t5
out m5(蓝灯亮)
out t5 k5
ldp t5
or m6
ani t6
out m6(紫灯亮)
out t6 k5
ld m0
out y1
ld m1
out y2
ld m2
out y3
ld m3
out y4
ld m4
out y5
ld m5
out y6
ld m6
out y7
end
灯y0红、橙、黄、绿、青、蓝、紫y1~y7
ld m8000 y0(主题灯亮)
ld m8002
or m0
orp t6
ani t0
out m0(红灯亮)
out t0 k5
ldp t0
or m1
ani t1
out m1(橙灯亮)
out t1 k5
ldp t1
or m2
ani t2
out m2(黄灯亮)
out t2 k5
ldp t2
or m3
ani t3
out m3(绿灯亮)
out t3 k5
ldp t3
or m4
ani t4
out m4(青灯亮)
out t4 k5
ldp t4
or m5
ani t5
out m5(蓝灯亮)
out t5 k5
ldp t5
or m6
ani t6
out m6(紫灯亮)
out t6 k5
ld m0
out y1
ld m1
out y2
ld m2
out y3
ld m3
out y4
ld m4
out y5
ld m5
out y6
ld m6
out y7
end