1, plc编程实例
TITLE=程序注释Network 1 // 网络标题// 网络注释LD SM0.1MOVW +0, VW0Network 2 LD I0.0EUINCW VW0Network 3 LDW>= VW0, +2AN Q0.2= M0.0Network 4 LDW>= VW0, +3AN Q0.3= M0.1Network 5 LD I0.2EUA M0.0O Q0.2AN Q0.3AN T37TON T37, +80= Q0.2Network 6 LD Q0.2ED-I +2, VW0Network 7 LD M0.0LD SM0.5A Q0.2OLD= Q0.0Network 8 LD I0.3EUA M0.1O Q0.3AN Q0.2AN T38TON T38, +80= Q0.3Network 9 LD Q0.3ED-I +3, VW0Network 10 LD M0.1LD SM0.5A Q0.3OLD= Q0.1Network 11 LD Q0.2EDLD Q0.3EDOLDO Q0.4AW>VW0, +0= Q0.4Network 12 LD I0.4O Q0.5AW>VW0, +0= Q0.5Network 13 // LD SM0.5EUA Q0.5DECW 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.7EULPSS Q1.6, 1A I2.0AN I1.1S Q0.0, 1LPPAN I2.0LPSA I2.1AN I1.2S Q0.1, 1LPPAN I2.1LPSA I2.2AN I1.3S Q0.4, 1LPPAN I2.2LPSA I2.3AN I1.4S Q0.5, 1LPPAN I2.3LPSA I2.4AN I1.5S Q1.0, 1LPPAN I2.4自己看吧