| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.IO;
- using System.Linq;
- using System.Net;
- using System.Text;
- using System.Timers;
- using System.Windows.Forms;
- using Curtain.DataAccess;
- using Curtain.Framework.Json;
- using Curtain.Net.Sockets.PLC;
- using Curtain.Net.Sockets.PLC.Model.Siemens;
- using Newtonsoft.Json.Linq;
- using PLC_S.EPTS;
- namespace TEST_HPGP
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
- try
- {
- INI_HPGP plc_ini = INI_HPGP.Get("HPGP1_1");
- plc_ini.INI_WS_CODE = "HPGP1_1";
- this.textBox1.Text += System.Environment.NewLine + button1.Text + System.Environment.NewLine;
- this.Do(plc_ini);
- //this.Do2(plc_ini);
- this.textBox1.SelectionStart = this.textBox1.TextLength;
- this.textBox1.ScrollToCaret();
- this.textBox1.Focus();
- }
- catch(Exception ex)
- {
- MessageBox.Show(ex.Message, "MAIN", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- try
- {
- INI_HPGP plc_ini = INI_HPGP.Get("HPGP1_2");
- plc_ini.INI_WS_CODE = "HPGP1_2";
- this.textBox1.Text += System.Environment.NewLine + button2.Text + System.Environment.NewLine;
- this.textBox1.SelectionStart = this.textBox1.TextLength;
- this.Do(plc_ini);
- //this.Do2(plc_ini);
- this.textBox1.SelectionStart = this.textBox1.TextLength;
- this.textBox1.ScrollToCaret();
- this.textBox1.Focus();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "MAIN", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- private void button3_Click(object sender, EventArgs e)
- {
- try
- {
- INI_HPGP plc_ini = INI_HPGP.Get("HPGP1_3");
- plc_ini.INI_WS_CODE = "HPGP1_3";
- this.textBox1.Text += System.Environment.NewLine + button3.Text + System.Environment.NewLine;
- this.textBox1.SelectionStart = this.textBox1.TextLength;
- this.Do(plc_ini);
- //this.Do2(plc_ini);
- this.textBox1.SelectionStart = this.textBox1.TextLength;
- this.textBox1.ScrollToCaret();
- this.textBox1.Focus();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.Message, "MAIN", MessageBoxButtons.OK, MessageBoxIcon.Error);
- }
- }
- private int Do(INI_HPGP plc_ini)
- {
- try
- {
- using (SocketClient<SiemensS7_1200Model> plc = new SocketClient<SiemensS7_1200Model>())
- {
- string outputMessage = $"[{plc_ini.INI_WS_CODE}]PLC_Connect={plc_ini.PLC_IP+":"+plc_ini.PLC_PORT}";
- //logger_t.OutputTrace(outputMessage);
- this.textBox1.Text += outputMessage + System.Environment.NewLine;
- try
- {
- plc.Connect(plc_ini.PLC_IP, plc_ini.PLC_PORT);
- }
- catch (Exception ex1)
- {
- //logger_t.OutputWarn(ex1.Message);
- //logger_e.OutputWarn(ex1.Message);
- //logger_e_out.OutputWarn(ex1.Message);
- MessageBox.Show(ex1.Message, "DO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.textBox1.Text += ex1.Message + System.Environment.NewLine;
- return 1;
- }
- // 1. 读取PLC 标识
- string s = null;
- if (plc_ini.Add_F_CodeNum == "2558")
- {
- s = "50.1";
- }
- if (plc_ini.Add_F_CodeNum == "2560")
- {
- s = "35.4";
- }
- if (plc_ini.Add_F_CodeNum == "2562")
- {
- s = "100.1";
- }
- PLCResult<bool> flag1_result = plc.Read<bool>("M", s);
- outputMessage = $"[{plc_ini.INI_WS_CODE}]注浆标识=[{flag1_result.Data}]{"M" + s}";
- //logger_t.OutputTrace(outputMessage);
- this.textBox1.Text += outputMessage + System.Environment.NewLine;
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]GET_F_Code=[ ]{plc_ini.Add_F_Code + plc_ini.Add_F_CodeNum}";
- ////logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += outputMessage + System.Environment.NewLine;
- PLCResult<short> flag_result = plc.Read<short>(plc_ini.Add_F_Code, plc_ini.Add_F_CodeNum);
- outputMessage = $"[{plc_ini.INI_WS_CODE}]注浆标识=[{flag_result.Data}]{plc_ini.Add_F_Code + plc_ini.Add_F_CodeNum}";
- //logger_t.OutputTrace(outputMessage);
- this.textBox1.Text += outputMessage + System.Environment.NewLine;
- //if (flag_result.Data != 1)
- //if (!flag_result.Data)
- {
- //return 1;
- }
- // 3. 读取PLC 模具是否注浆
- JObject jGroutingData = new JObject();
- jGroutingData.Add("GROUTINGDATE", DateTime.Now.ToString("yyyy-MM-dd"));
- jGroutingData.Add("GROUTINGLINECODE", plc_ini.GL_CODE);
- jGroutingData.Add("GROUTINGTIMES", 1);
- JArray jGROUTINGLINEDETAIL = new JArray();
- for (int i = 0; i < 10; i++)
- {
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]GET_G_{i}=[ ]{plc_ini.Add_Gs[i] + plc_ini.Add_G_NUMs[i]}";
- ////logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += outputMessage + System.Environment.NewLine;
- PLCResult<bool> g_result = plc.Read<bool>(plc_ini.Add_Gs[i], plc_ini.Add_G_NUMs[i]);
- outputMessage = $"[{plc_ini.INI_WS_CODE}]模具注浆{i+1}=[{g_result.Data}]{plc_ini.Add_Gs[i] + plc_ini.Add_G_NUMs[i]}";
- //logger_t.OutputTrace(outputMessage);
- this.textBox1.Text += outputMessage + System.Environment.NewLine;
- JObject jToken = new JObject();
- jToken.Add("GROUTINGMOULDCODE", plc_ini.GL_CODE + $"-{(i + 1):000}");
- //if (g_result.Data == 1)
- if (g_result.Data)
- {
- jToken.Add("GROUTINGFLAG", "1");
- jToken.Add("NOGROUTINGRREASON", "null");
- }
- else
- {
- //jToken.Add("GROUTINGFLAG", "0");
- //jToken.Add("NOGROUTINGRREASON", plc_ini.NOGROUTINGRREASON);
- }
- jGROUTINGLINEDETAIL.Add(jToken);
- }
- jGroutingData.Add("GROUTINGLINEDETAIL", jGROUTINGLINEDETAIL);
- string groutingData = jGroutingData.ToString();
- // 工号
- string usercode = "";
- DataRow dataRow = null;
- //using (IDataAccess dataAccess = PLC_S_DataAccess.GetDataAccess())
- {
- string sqlString = $@"SELECT t.usercode
- ,gl.h_linecode
- ,gl.h_lineindex
- ,gl.h_batchno
- ,gl.h_batchindex
- FROM tp_mst_workstation t
- INNER JOIN tp_pc_groutingline gl
- ON gl.groutinglineid = t.groutinglineid
- WHERE t.workstationtypeid = 3501
- AND t.workstationid = {plc_ini.WS_ID}
- AND t.groutinglineid = {plc_ini.GL_ID}";
- //this.textBox1.Text += sqlString + System.Environment.NewLine;
- // CDAParameter[] ps = new CDAParameter[]
- // {
- // new CDAParameter("groutinglineid", plc_ini.GL_ID),
- // new CDAParameter("workstationid", plc_ini.WS_ID),
- // };
- // DataTable dataTable = dataAccess.ExecuteDatatable(sqlString, ps);
- // if (dataTable.HasData())
- // {
- // dataRow = dataTable.Rows[0];
- // usercode = dataTable.Rows[0]["usercode"].ToString();
- // }
- //}
- //ServiceResultEntity result = SmartDeviceProxy.Instance.Invoke<ServiceResultEntity>(
- // p => p.SetHGrouting(
- // _mes_s.AccountCode,
- // usercode,
- // plc_ini.GL_CODE,
- // groutingData,
- // null));
- //// 返回状态(成功、失败)
- //if (result.Status != ServiceResultStatus.Success)
- //{
- // if (result.Status == ServiceResultStatus.SystemError)
- // {
- // outputMessage = $"MES服务端异常(详情参见MES端日志)";
- // }
- // else if (result.Message == "EU-01")
- // {
- // outputMessage = $"无效的帐套或工号(详情参见MES端日志)";
- // }
- // else
- // {
- // outputMessage = $"其他错误(详情参见MES端日志)[{result}]";
- // }
- // logger_e_out.OutputError(null, outputMessage);
- // logger_t.OutputError(null, outputMessage);
- // logger_e.OutputError(null, outputMessage);
- // this.textBox1.Text += outputMessage + System.Environment.NewLine;
- // return 1;
- }
- if (flag_result.Data == 1)
- {
- //plc_ini.GDD_ID = result.Result.ToInt32();
- // 7. 写入PLC 标识 = 2
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]SET_F_Code=[ ]{plc_ini.Add_F_Code + plc_ini.Add_F_CodeNum}";
- ////logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += outputMessage + System.Environment.NewLine;
- //PLCResult f_result = plc.Write<short>(plc_ini.Add_F_Code, plc_ini.Add_F_CodeNum, 2);
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]SET_F_Code=[2]{plc_ini.Add_F_Code + plc_ini.Add_F_CodeNum}";
- ////logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += outputMessage + System.Environment.NewLine;
- }
- else
- {
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]SET_F_Code=[ ]{plc_ini.Add_F_Code + plc_ini.Add_F_CodeNum}";
- ////logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += outputMessage + System.Environment.NewLine;
- }
- // 低注时间
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]GET_Add_LZ=[ ]{plc_ini.Add_LZ + plc_ini.Add_LZ_NUM}";
- ////logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += "低注时间" + System.Environment.NewLine;
- PLCResult<short> lz_result = plc.Read<short>(plc_ini.Add_LZ, plc_ini.Add_LZ_NUM);
- outputMessage = $"[{plc_ini.INI_WS_CODE}]低注时间=[{lz_result.Data}]{plc_ini.Add_LZ + plc_ini.Add_LZ_NUM}";
- //logger_t.OutputTrace(outputMessage);
- this.textBox1.Text += outputMessage + System.Environment.NewLine;
- // 高注时间
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]GET_Add_GZ=[ ]{plc_ini.Add_GZ + plc_ini.Add_GZ_NUM}";
- ////logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += "高注时间" + System.Environment.NewLine;
- PLCResult<short> gz_result = plc.Read<short>(plc_ini.Add_GZ, plc_ini.Add_GZ_NUM);
- outputMessage = $"[{plc_ini.INI_WS_CODE}]高注时间=[{gz_result.Data}]{plc_ini.Add_GZ + plc_ini.Add_GZ_NUM}";
- //logger_t.OutputTrace(outputMessage);
- this.textBox1.Text += outputMessage + System.Environment.NewLine;
- // 排泥时间
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]GET_Add_PN=[ ]{plc_ini.Add_PN + plc_ini.Add_PN_NUM}";
- ////logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += "排泥时间" + System.Environment.NewLine;
- PLCResult<short> pn_result = plc.Read<short>(plc_ini.Add_PN, plc_ini.Add_PN_NUM);
- outputMessage = $"[{plc_ini.INI_WS_CODE}]排泥时间=[{pn_result.Data}]{plc_ini.Add_PN + plc_ini.Add_PN_NUM}";
- //logger_t.OutputTrace(outputMessage);
- this.textBox1.Text += outputMessage + System.Environment.NewLine;
- // 巩固时间
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]GET_Add_GG=[ ]{plc_ini.Add_GG + plc_ini.Add_GG_NUM}";
- ////logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += "巩固时间" + System.Environment.NewLine;
- PLCResult<short> gg_result = plc.Read<short>(plc_ini.Add_GG, plc_ini.Add_GG_NUM);
- outputMessage = $"[{plc_ini.INI_WS_CODE}]巩固时间=[{gg_result.Data}]{plc_ini.Add_GG + plc_ini.Add_GG_NUM}";
- //logger_t.OutputTrace(outputMessage);
- this.textBox1.Text += outputMessage + System.Environment.NewLine;
- float[] fs = GetPT_NUM(plc_ini);
- // using (IDataAccess dataAccess = PLC_S_DataAccess.GetDataAccess())
- // {
- // //dataAccess.Open(true);
- // string sqlString = @"
- //INSERT INTO TP_PM_H_GroutingParas
- // (GroutingDailyID
- // ,GroutingLineID
- // ,GroutingLineCode
- // ,H_LineCode
- // ,H_LineIndex
- // ,H_BatchNo
- // ,H_BatchIndex
- // ,lz_time
- // ,gz_time
- // ,pn_time
- // ,gg_time
- // ,g_pressure
- // ,g_temperature
- // )
- //VALUES
- // (@GroutingDailyID@
- // ,@GroutingLineID@
- // ,@GroutingLineCode@
- // ,@H_LineCode@
- // ,@H_LineIndex@
- // ,@H_BatchNo@
- // ,@H_BatchIndex@
- // ,@lz_time@
- // ,@gz_time@
- // ,@pn_time@
- // ,@gg_time@
- // ,@g_pressure@
- // ,@g_temperature@
- // )";
- // CDAParameter[] ps = new CDAParameter[]
- // {
- // new CDAParameter("GroutingDailyID", plc_ini.GDD_ID),
- // new CDAParameter("GroutingLineID", plc_ini.GL_ID),
- // new CDAParameter("GroutingLineCode", plc_ini.GL_CODE),
- // new CDAParameter("H_LineCode", plc_ini.GL_H_CODE),
- // new CDAParameter("H_LineIndex", plc_ini.GL_H_INDEX),
- // new CDAParameter("H_BatchNo", dataRow["H_BatchNo"]),
- // new CDAParameter("H_BatchIndex", dataRow["H_BatchIndex"]),
- // new CDAParameter("lz_time", lz_result.Data),
- // new CDAParameter("gz_time", gz_result.Data),
- // new CDAParameter("pn_time", pn_result.Data),
- // new CDAParameter("gg_time", gg_result.Data),
- // new CDAParameter("g_pressure", (fs==null?0f:fs[0])),
- // new CDAParameter("g_temperature", (fs==null?0f:fs[1])),
- // };
- // dataAccess.ExecuteNonQuery(sqlString, ps);
- // sqlString = @"
- //INSERT INTO TP_PM_H_GROUTINGPARAS_PT
- // (HGPT_ID
- // ,groutingdailyid
- // ,g_pressure
- // ,g_temperature
- // )
- //VALUES
- // (SEQ_PM_H_GROUTINGPARAS_PT.Nextval
- // ,@groutingdailyid@
- // ,@g_pressure@
- // ,@g_temperature@
- // )";
- // ps = new CDAParameter[]
- // {
- // new CDAParameter("groutingdailyid", plc_ini.GDD_ID),
- // new CDAParameter("g_pressure", (fs==null?0f:fs[0])),
- // new CDAParameter("g_temperature", (fs==null?0f:fs[1])),
- // };
- // dataAccess.ExecuteNonQuery(sqlString, ps);
- // //dataAccess.Commit();
- // }
- }
- }
- catch (Exception ex)
- {
- //logger_e_out.OutputError(ex);
- //logger_e.OutputError(ex);
- //logger_t.OutputError(ex);
- //FormLogShow?.ShowLog($"[{plc_ini.INI_WS_CODE}]ERROR={ex.Message}");
- MessageBox.Show(ex.Message, "DO", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.textBox1.Text += ex.Message + System.Environment.NewLine;
- return 1;
- }
- finally
- {
- //logger_t.EndTracking();
- }
- return 2;
- }
- private int Do2(INI_HPGP plc_ini)
- {
- try
- {
- //logger_t.BeginTracking();
- using (SocketClient<SiemensS7_1200Model> plc = new SocketClient<SiemensS7_1200Model>())
- {
- string outputMessage = $"[{plc_ini.INI_WS_CODE}]PLC_Connect={JsonHelper.FromObject(plc_ini)}";
- //logger_t.OutputTrace(outputMessage);
- this.textBox1.Text += outputMessage + System.Environment.NewLine;
- try
- {
- plc.Connect(plc_ini.PLC_IP, plc_ini.PLC_PORT);
- }
- catch (Exception ex1)
- {
- //logger_t.OutputWarn(ex1.Message);
- //logger_e.OutputWarn(ex1.Message);
- //logger_e_out.OutputWarn(ex1.Message);
- MessageBox.Show(ex1.Message, "DO2", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.textBox1.Text += ex1.Message + System.Environment.NewLine;
- return 1;
- }
- // 1. 读取PLC 标识
- ////outputMessage = $"[{plc_ini.INI_WS_CODE}]GET_F_Code=[ ]{plc_ini.Add_F_Code + plc_ini.Add_F_CodeNum}";
- //////logger_t.OutputTrace(outputMessage);
- ////this.textBox1.Text += outputMessage + System.Environment.NewLine;
- //PLCResult<short> flag_result = plc.Read<short>(plc_ini.Add_F_Code, plc_ini.Add_F_CodeNum);
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]GET_F_Code=[{flag_result.Data}]{plc_ini.Add_F_Code + plc_ini.Add_F_CodeNum}";
- ////logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += outputMessage + System.Environment.NewLine;
- //PLCResult f_result = plc.Write<short>(plc_ini.Add_F_Code, plc_ini.Add_F_CodeNum, 2);
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]SET_F_Code=[2]{plc_ini.Add_F_Code + plc_ini.Add_F_CodeNum}";
- ////logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += outputMessage + System.Environment.NewLine;
- //if (flag_result.Data != 2)
- //if (!flag_result.Data)
- {
- return 1;
- }
- float[] fs = GetPT_NUM(plc_ini);
- if (fs == null || fs.Length < 2)
- {
- return 1;
- }
- // using (IDataAccess dataAccess = PLC_S_DataAccess.GetDataAccess())
- // {
- // string sqlString = @"
- //INSERT INTO TP_PM_H_GROUTINGPARAS_PT
- // (HGPT_ID
- // ,groutingdailyid
- // ,g_pressure
- // ,g_temperature
- // )
- //VALUES
- // (SEQ_PM_H_GROUTINGPARAS_PT.Nextval
- // ,@groutingdailyid@
- // ,@g_pressure@
- // ,@g_temperature@
- // )";
- // CDAParameter[] ps = new CDAParameter[]
- // {
- // new CDAParameter("groutingdailyid", plc_ini.GDD_ID),
- // new CDAParameter("g_pressure", fs[0]),
- // new CDAParameter("g_temperature", fs[1]),
- // };
- // dataAccess.ExecuteNonQuery(sqlString, ps);
- // }
- }
- }
- catch (Exception ex)
- {
- //logger_e_out.OutputError(ex);
- //logger_e.OutputError(ex);
- //logger_t.OutputError(ex);
- //FormLogShow?.ShowLog($"[{plc_ini.INI_WS_CODE}]ERROR={ex.Message}");
- MessageBox.Show(ex.Message, "DO2", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.textBox1.Text += ex.Message + System.Environment.NewLine;
- return 1;
- }
- finally
- {
- //logger_t.EndTracking();
- }
- return 2;
- }
- private float[] GetPT_NUM(INI_HPGP plc_ini)
- {
- using (SocketClient<SiemensS7_1200Model> plc = new SocketClient<SiemensS7_1200Model>())
- {
- string outputMessage = $"[{plc_ini.INI_WS_CODE}]PLC_Connect={plc_ini.PT_IP + ":" + plc_ini.PT_PORT}";
- //logger_t.OutputTrace(outputMessage);
- this.textBox1.Text += outputMessage + System.Environment.NewLine;
- try
- {
- plc.Connect(plc_ini.PT_IP, plc_ini.PT_PORT);
- }
- catch (Exception ex1)
- {
- //logger_t.OutputWarn(ex1.Message);
- //logger_e.OutputWarn(ex1.Message);
- //logger_e_out.OutputWarn(ex1.Message);
- MessageBox.Show(ex1.Message, "DO_PT", MessageBoxButtons.OK, MessageBoxIcon.Warning);
- this.textBox1.Text += ex1.Message + System.Environment.NewLine;
- return null;
- }
- // 压力
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]GET_PT_P=[ ]{plc_ini.PT_P_Code + plc_ini.PT_P_NUM}";
- ////logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += "压力" + System.Environment.NewLine;
- PLCResult<short> p_result = plc.Read<short>(plc_ini.PT_P_Code, plc_ini.PT_P_NUM);
- outputMessage = $"[{plc_ini.INI_WS_CODE}]压力=[{p_result.Data / 10f}]{plc_ini.PT_P_Code + plc_ini.PT_P_NUM}";
- //logger_t.OutputTrace(outputMessage);
- this.textBox1.Text += outputMessage + System.Environment.NewLine;
- // 温度
- //outputMessage = $"[{plc_ini.INI_WS_CODE}]GET_PT_T=[ ]{plc_ini.PT_T_Code + plc_ini.PT_T_NUM}";
- //logger_t.OutputTrace(outputMessage);
- //this.textBox1.Text += "温度" + System.Environment.NewLine;
- PLCResult<short> t_result = plc.Read<short>(plc_ini.PT_T_Code, plc_ini.PT_T_NUM);
- outputMessage = $"[{plc_ini.INI_WS_CODE}]温度=[{t_result.Data / 10f}]{plc_ini.PT_T_Code + plc_ini.PT_T_NUM}";
- //logger_t.OutputTrace(outputMessage);
- this.textBox1.Text += outputMessage + System.Environment.NewLine;
- float[] fs = new float[2];
- fs[0] = p_result.Data / 10f;
- fs[1] = t_result.Data / 10f;
- return fs;
- }
- }
- private void button4_Click(object sender, EventArgs e)
- {
- string s = "\u0000\u0000\u0000\u0000";
- bool b = s.StartsWith("\u0000");
- this.textBox1.Clear();
- }
- }
- }
|