我最近使用西门子CPU224XP CN 驱动步进马达,遇到一些问题,当我编程刚刚下载程序时,完全一切正常,但是如果PLC断电重起后,步进马达就无法运转,用西门子编程软件监控发现,PLC重新启动后,状态S0.2会自动为ON。步进程序是由PTO向导产生的,我单独调用RUN 程序,不存在PLC重新加电不运转的情况,我把程序贴出来,望高手帮忙参考,谢谢!
LD SM0.1
S S0.0, 1
LSCR S0.0
LD I0.0
A I0.2
A I0.3
SCRT S0.1
SCRE
LSCR S0.1
LD S0.1
S Q0.2, 1
LD I0.1
SCRT S0.2
SCRE
LSCR S0.2
LD S0.2
S Q0.4, 1
R Q0.5, 1
LD S0.2
= L60.0
LD I0.1
= L63.7
LD L60.0
CALL PTO0_RUN, L63.7, 0, I1.0, M1.2, VB940, VB941, VB942, VD944
LD I1.0
SCRT S0.3
SCRE
LSCR S0.3
LD S0.3
R Q0.2, 1
LD I0.2
SCRT S0.4
SCRE
LSCR S0.4
LD S0.4
S Q0.3, 1
LD I0.4
SCRT S0.5
SCRE
LSCR S0.5
LD S0.5
S Q0.2, 1
LD I0.1
SCRT S0.6
SCRE
LSCR S0.6
LD S0.6
S Q0.5, 1
R Q0.2, 1
R Q0.4, 1
LD I0.2
SCRT S0.7
SCRE
LSCR S0.7
LD S0.7
R Q0.3, 1
LD I0.3
SCRT S0.0
SCRE |