西门子PLC卡件CPU222CN西门子PLC卡件CPU222CN
TITLE=子程序注释
Network 1 // 手动归零
// 网络注释
LD I0.3
O M1.1
EU
S M1.0, 1
Network 2 // 归零动作
// 复位下降电磁阀
// 滑台复位回归
// 单双面位置复归
// 归零完成
LD M1.0
LPS
EU
R M3.0, 5
LRD
AN I2.3
= Q0.3为什么没有输出呢()
LRD
A I1.0
A I2.3
AN Q0.7
AN I2.4
= Q0.6
LRD
AN I1.0
A I2.3
AN Q0.6
AN I2.5
= Q0.7
LPP
LD I1.0
A I2.4
A I2.3
LDN I1.0
A I2.5
A I2.3
OLD
ALD
R M1.0, 1
Network 3 // 起始步
// 1步进启动
// 2单面感应启动
// 3双面出口启动
LD SM0.0
LD I0.1
A I0.2
LD I0.7
AN I1.0
AN I0.1
OLD
LD I1.0
A I1.2
A S1.3
A Q1.3
OLD
ALD
EU
S M3.1, 1
Network 4 // 步1开始
// 吸盘下降,真空吸盘取料
LD M3.1
LPS
LDN I0.1
O Q0.4
LD I0.1
A I0.2
OLD
ALD
= Q0.4
= Q0.5
TON T37, VW20
LPP
LD I2.0
O T37
ALD
S M3.2, 1
Network 5 // 吸盘上升
// 1手动步进
// 2自动双面
// 3自动单面
LD M3.2
LPS
LD Q0.5
LD I0.1
A I0.2
OLD
LDN I0.1
LDN I1.0
LD I1.0
A M1.4
AN Q1.3
A I1.6
OLD
ALD
OLD
ALD
R M3.1, 1
= Q0.5
TON T38, VW22
LPP
LD I2.1
O T38
ALD
S M3.3, 1
Network 6 // 入口滑台平移
// 1手动平移
// 2自动单面平移
// 3自动双面转单面平移
LD M3.3
LPS
LD I0.1
A I0.2
ON I0.1
O Q0.5
ALD
LPS
R M3.2, 1
A I2.5
= Q0.2
LPP
= Q0.5
LPP
A I2.2
S M3.4, 1
Network 7 // 带料吸盘下降
LD M3.4
LD I0.1
A I0.2
LDN I0.1
AN I2.0
OLD
O Q0.4
ALD
LPS
R M3.3, 1
AN I2.0
= Q0.5
LRD
AN I2.0
= Q0.4
LPP
TON T39, VW20
Network 8 // 上限位到达
LD M3.4
LD I2.1
O T39
ALD
S M3.5, 1
Network 9
LD M3.5
R M3.4, 1
TON T40, VW22
LD T40
O Q0.3
ALD
= Q0.3
Network 10
LD M3.5
A I2.3
= M1.1
Network 11
LD SM0.0
CRET