博思科技自动焊接系统中用S7200控制两台步进电机和一台台达变频器。如有兴趣 电话024-22943077
台达变频器与S7224XP通过MODBUS RTU通讯,以下为程序(无法上传附件和图片,不好意思)
LD M20.3
O M20.3
AN M20.5
AN M20.4
= M20.3
LD M20.4
O M20.4
AN M20.5
AN M20.3
= M20.4
LD M20.5
EU
TOF T34, 10
LD T34
= M20.5
LD M20.3
MOVB 18, VB1201(正转)
LD M20.4
MOVB 34, VB1201(反转)
LD M20.5
MOVB 1, VB1201(停止)
LD Always_On:SM0.0
CALL Scale_R_to_R:SBR13, VD620, 10.0, 0.0, 5000.0, 0.0, VD624
TRUNC VD624, VD628
LD Always_On:SM0.0
DTI VD628, VW1202(将设定转速转换为四位整数)
LD Always_On:SM0.0
CALL Scale_I_to_R:SBR14, VW1106, 5000, 0, 50.0, 0.0, VD640
LDB<> VB1003, 0
OB<> VB1005, 0
= M20.6
LDN V1002.4
TON T33, 20
LD T33
AN V1002.1
S V1002.4, 1
LDN T33
AN V1002.4
S V1002.1, 1
LD First_Scan_On:SM0.1
R V1002.4, 1
R V1200.0, 16
R V1002.1, 1
LD Always_On:SM0.0
= L60.0
LD Always_On:SM0.0
= L63.7
LD L60.0
CALL MBUS_CTRL:SBR1, L63.7, 19200, 1, 1000, V1000.0, VB1001
LD V1002.4
= L60.0
LD V1002.4
EU
= L63.7
LD L60.0
CALL MBUS_MSG:SBR2, L63.7, 3, 0, 48449, 4, &VB1100, V1002.2, VB1003
LD V1002.2
R V1002.4, 1
LD V1002.1
= L60.0
LD V1002.1
EU
= L63.7
LD L60.0
CALL MBUS_MSG:SBR2, L63.7, 3, 1, 48193, 2, &VB1200, V1002.3, VB1005
LD V1002.3
R V1002.1, 1