欢迎来到朵拉利品网
知识中心
资讯
  • 资讯
  • 产品
  • 供应商
您的位置: 朵拉利品网 >  知识中心 > PLC编程例题 plc编程实例
PLC编程例题 plc编程实例
2019-07-04 09:06:53 来源:朵拉利品网

1, plc编程实例



TITLE=程序注释
Network 1 // 网络标题
// 网络注释
LD SM0.1
MOVW +0, VW0
Network 2
LD I0.0
EU
INCW VW0
Network 3
LDW>= VW0, +2
AN Q0.2
= M0.0
Network 4
LDW>= VW0, +3
AN Q0.3
= M0.1
Network 5
LD I0.2
EU
A M0.0
O Q0.2
AN Q0.3
AN T37
TON T37, +80
= Q0.2
Network 6
LD Q0.2
ED
-I +2, VW0
Network 7
LD M0.0
LD SM0.5
A Q0.2
OLD
= Q0.0
Network 8
LD I0.3
EU
A M0.1
O Q0.3
AN Q0.2
AN T38
TON T38, +80
= Q0.3
Network 9
LD Q0.3
ED
-I +3, VW0
Network 10
LD M0.1
LD SM0.5
A Q0.3
OLD
= Q0.1
Network 11
LD Q0.2
ED
LD Q0.3
ED
OLD
O Q0.4
AW>VW0, +0
= Q0.4
Network 12
LD I0.4
O Q0.5
AW>VW0, +0
= Q0.5
Network 13
//
LD SM0.5
EU
A Q0.5
DECW VW0
我编了个你看看i0.0 1元硬币i0.2 买汽水i0.3 买咖啡i0.4 退币q0.0 汽水灯q0.1咖啡灯q0.2倒汽水q0.3倒咖啡q0.4退币指示灯q0.5退币

2, 西门子plc编程实例、



LD I2.7
EU
LPS
S Q1.6, 1
A I2.0
AN I1.1
S Q0.0, 1
LPP
AN I2.0
LPS
A I2.1
AN I1.2
S Q0.1, 1
LPP
AN I2.1
LPS
A I2.2
AN I1.3
S Q0.4, 1
LPP
AN I2.2
LPS
A I2.3
AN I1.4
S Q0.5, 1
LPP
AN I2.3
LPS
A I2.4
AN I1.5
S Q1.0, 1
LPP
AN I2.4
自己看吧