发布于 2008-04-17 08:38:06
0楼
自己写程序吗?runtime,运行时间,runtime_sp,运行时间设定,stoptime,停止时间,stoptime_sp,停止时间设定start,启动按钮,stop,停止按钮run运行状态,flg1运行结束,flg2,停止结束,out,输出控制点(控制电机)
a start
s run
r flg1
a flg2
r start
a run
an flg1
jcn m1
s flg2
l 0.0
t stoptime
l 0.5
l runtime
+r
t runtime
l runtime_sp
>=r
=flg1
an flg1
s out
m1:a run
a flg1
jcn m2
r flg2
r out
l 0.0
t rutime
l 0.5
l stoptime
+r
t stoptime
l stoptime_sp
>=r
=flg2
a flg2
r flg1
m2:nop 0
T1为上面的runtime_sp,T2为stoptime_sp,直接修改这两个值就可以了!可以将它们连接到上位机,再上位机直接输入。上面的程序放在500ms的中断中使用。T1、T2单位为S。
活到老,学到老!为了生活学习吧!