|
|
@@ -3800,22 +3800,22 @@ namespace Dongke.IBOSS.PRD.Service.SystemModuleLogic
|
|
|
using (SocketClient<SiemensS7_1200Model> plc = new SocketClient<SiemensS7_1200Model>())
|
|
|
{
|
|
|
//测试静态数据 测试成功
|
|
|
- plc.Connect(ip, port);
|
|
|
- plc.Write<int>("DB", "2000.0", Convert.ToInt16(1));
|
|
|
- plc.Write<int>("DB", "2000.2", Convert.ToInt16(75));
|
|
|
- plc.Write<int>("DB", "2000.4", Convert.ToInt16(1));
|
|
|
- plc.Write<int>("DB", "2000.6", Convert.ToInt16(306));
|
|
|
- plc.Write<string>("DB", "2000.8", "A00A02");
|
|
|
- plc.Write<string>("DB", "2000.16", "22222222222");
|
|
|
+ //plc.Connect(ip, port);
|
|
|
+ //plc.Write<short>("DB", "2000.0", Convert.ToInt16(1));
|
|
|
+ //plc.Write<short>("DB", "2000.2", Convert.ToInt16(75));
|
|
|
+ //plc.Write<short>("DB", "2000.4", Convert.ToInt16(1));
|
|
|
+ //plc.Write<short>("DB", "2000.6", Convert.ToInt16(306));
|
|
|
+ //plc.Write<string>("DB", "2000.10", "A00A02");
|
|
|
+ //plc.Write<string>("DB", "2000.18", "22222222222");
|
|
|
|
|
|
//手动写
|
|
|
- //plc.Connect(ip, port);
|
|
|
- //plc.Write<int>("D", "102.0", Convert.ToInt16(1));
|
|
|
- //plc.Write<int>("D", "102.2", SEATCOVERCODE);
|
|
|
- //plc.Write<int>("D", "102.12", GOODSTYPE);
|
|
|
- //plc.Write<int>("D", "102.22", GOODSSPECIFICATION1);
|
|
|
- //plc.Write<string>("D", "102.32", GROUTINGLINECODE1);
|
|
|
- //plc.Write<string>("D", "102.42", BarCode);
|
|
|
+ plc.Connect(ip, port);
|
|
|
+ plc.Write<short>("DB", "2000.0", Convert.ToInt16(1));
|
|
|
+ plc.Write<short>("DB", "2000.2", Convert.ToInt16(SEATCOVERCODE));
|
|
|
+ plc.Write<short>("DB", "2000.4", Convert.ToInt16(GOODSTYPE));
|
|
|
+ plc.Write<short>("DB", "2000.6", Convert.ToInt16(GOODSSPECIFICATION1));
|
|
|
+ plc.Write<string>("DB", "2000.10", GROUTINGLINECODE1);
|
|
|
+ plc.Write<string>("DB", "2000.18", BarCode);
|
|
|
|
|
|
var a = plc.Read<string>("DB", "2000.0");
|
|
|
var a1 = plc.Read<string>("DB", "2000.2");
|