| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using DK.XuWei.WebMes;
- using Curtain.DataAccess;
- using Curtain.Log;
- using System.Data;
- /// <summary>
- /// 发送LED看板数据到PLC xuwei add 2023-05-12
- /// </summary>
- public static class Led
- {
- public static void SendData()
- {
- //读取看板数据
- using (IDataAccess conn = DataAccess.Create())
- {
- DataTable dt = conn.ExecuteDatatable(@"
- SELECT
- *
- FROM
- TP_MST_USER
- WHERE
- VALUEFLAG = '1'
- AND USERID = @USERID@
- ",
- new CDAParameter("USERID", "")
- );
- }
- Logger.Debug("读取看板数据完成!");
- //发送数据到LED
- SiemensS7.Open("172.19.2.71", 102);
- SiemensS7.Write<short>("5.0", (Int16)99);//包装总量
- SiemensS7.Write<short>("5.2", (Int16)99);//一线包装产量
- SiemensS7.Write<short>("5.4", (Int16)99);//二线包装产量
- SiemensS7.Write<short>("5.6", (Int16)99);//一线7:30-9:00产量
- SiemensS7.Write<short>("5.8", (Int16)99);//一线9:00-10:00产量
- SiemensS7.Write<short>("5.10", (Int16)99);//一线10:00-11:00产量
- SiemensS7.Write<short>("5.12", (Int16)99);//一线12:00-14:00产量
- SiemensS7.Write<short>("5.14", (Int16)99);//一线14:00-15:00产量
- SiemensS7.Write<short>("5.16", (Int16)99);//一线15:00-16:00产量
- SiemensS7.Write<short>("5.18", (Int16)99);//一线16:00-17:00产量
- SiemensS7.Write<short>("5.20", (Int16)99);//一线17:00-18:00产量
- SiemensS7.Write<short>("5.22", (Int16)99);//二线7:30-9:00产量
- SiemensS7.Write<short>("5.24", (Int16)99);//二线9:00-10:00产量
- SiemensS7.Write<short>("5.26", (Int16)99);//二线10:00-11:00产量
- SiemensS7.Write<short>("5.28", (Int16)99);//二线12:00-14:00产量
- SiemensS7.Write<short>("5.30", (Int16)99);//二线14:00-15:00产量
- SiemensS7.Write<short>("5.32", (Int16)99);//二线15:00-16:00产量
- SiemensS7.Write<short>("5.34", (Int16)99);//二线16:00-17:00产量
- SiemensS7.Write<short>("5.36", (Int16)99);//二线17:00-18:00产量
- SiemensS7.Close();
- Logger.Debug("发送LED数据完成!");
- }
- }
|