feat - 完善日志,更新逻辑

master
SoulStar 3 months ago
parent cea8cc9585
commit 3cf29b3435

@ -0,0 +1,124 @@
namespace Sln.FormTest
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
button1 = new Button();
button2 = new Button();
button3 = new Button();
button4 = new Button();
button5 = new Button();
button6 = new Button();
SuspendLayout();
//
// button1
//
button1.Location = new Point(106, 102);
button1.Name = "button1";
button1.Size = new Size(75, 23);
button1.TabIndex = 0;
button1.Text = "button1";
button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click;
//
// button2
//
button2.Location = new Point(225, 102);
button2.Name = "button2";
button2.Size = new Size(75, 23);
button2.TabIndex = 1;
button2.Text = "button2";
button2.UseVisualStyleBackColor = true;
button2.Click += button2_Click;
//
// button3
//
button3.Location = new Point(364, 102);
button3.Name = "button3";
button3.Size = new Size(75, 23);
button3.TabIndex = 2;
button3.Text = "button3";
button3.UseVisualStyleBackColor = true;
button3.Click += button3_Click;
//
// button4
//
button4.Location = new Point(491, 102);
button4.Name = "button4";
button4.Size = new Size(75, 23);
button4.TabIndex = 3;
button4.Text = "button4";
button4.UseVisualStyleBackColor = true;
button4.Click += button4_Click;
//
// button5
//
button5.Location = new Point(604, 102);
button5.Name = "button5";
button5.Size = new Size(75, 23);
button5.TabIndex = 4;
button5.Text = "button5";
button5.UseVisualStyleBackColor = true;
button5.Click += button5_Click;
//
// button6
//
button6.Location = new Point(741, 102);
button6.Name = "button6";
button6.Size = new Size(75, 23);
button6.TabIndex = 5;
button6.Text = "button6";
button6.UseVisualStyleBackColor = true;
button6.Click += button6_Click;
//
// Form1
//
AutoScaleDimensions = new SizeF(7F, 17F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(1125, 700);
Controls.Add(button6);
Controls.Add(button5);
Controls.Add(button4);
Controls.Add(button3);
Controls.Add(button2);
Controls.Add(button1);
Name = "Form1";
Text = "Form1";
ResumeLayout(false);
}
#endregion
private Button button1;
private Button button2;
private Button button3;
private Button button4;
private Button button5;
private Button button6;
}
}

@ -0,0 +1,40 @@
namespace Sln.FormTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
}
private void button3_Click(object sender, EventArgs e)
{
}
private void button4_Click(object sender, EventArgs e)
{
}
private void button5_Click(object sender, EventArgs e)
{
}
private void button6_Click(object sender, EventArgs e)
{
}
}
}

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

@ -0,0 +1,17 @@
namespace Sln.FormTest
{
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
}
}
}

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows7.0</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
</Project>

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sln.FormTest
{
public class TestVar
{
}
}

@ -129,7 +129,7 @@ namespace Sln.Iot.Business
if (errorList.Where(x => x.ErrorName == errorMessage.ENAlarmMessage).Count() != 0)
{
//删除错误
string delGuid = errorService.DeleteVacuum2Error(errorMessage.ENAlarmMessage);
string delGuid = errorService.DeleteVacuum1Error(errorMessage.ENAlarmMessage);
Guid.TryParse(delGuid, out Guid guidRes);
connect1.PublishEvent(new CFXEnvelope(faultClearedEvent.Handle(guidRes)));
_log.Info($"真空箱1报警消除 内容:{errorMessage.CNAlarmMessage} 级别:{errorMessage.AlarmDegarde.GetDescription()}");

@ -15,6 +15,7 @@ using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using TouchSocket.Core;
using static System.Runtime.CompilerServices.RuntimeHelpers;
namespace Sln.Iot.Business
@ -63,23 +64,40 @@ namespace Sln.Iot.Business
{
//读取托盘码和产品码
OperateResult<byte[]> trayBytesResult = _plc.ReadBytes(_plc.DeltaInstance3, "D5000", 10);
OperateResult<byte[]> pordBytesResult = _plc.ReadBytes(_plc.DeltaInstance3, "D8000", 60);
OperateResult<byte[]> pordBytesResult1 = _plc.ReadBytes(_plc.DeltaInstance3, "D8000", 90);
OperateResult<byte[]> pordBytesResult2 = _plc.ReadBytes(_plc.DeltaInstance3, "D8090", 90);
//成功验证
if (trayBytesResult.IsSuccess && pordBytesResult.IsSuccess)
if (trayBytesResult.IsSuccess && pordBytesResult1.IsSuccess && pordBytesResult2.IsSuccess)
{
//转换托盘码
string traycode = Encoding.ASCII.GetString(trayBytesResult.Content);
traycode = traycode.Replace("\0", "");
_log.Info($"RFID01 [{traycode}]");
byte[] prodBytes = pordBytesResult.Content;
_log.Info($"托盘到达-RFID01-托盘号-[{traycode}]");
byte[] prodBytes = pordBytesResult1.Content.Concat(pordBytesResult2.Content).ToArray();
string[] prodcode = new string[6];
//分割转换产品码
for (int i = 0; i < 6; i++)
{
prodcode[i] = Encoding.ASCII.GetString(prodBytes[(i * 20)..(i * 20 + 20)]);
prodcode[i] = Encoding.ASCII.GetString(prodBytes[(i * 60)..(i * 60 + 60)]);
prodcode[i] = prodcode[i].Replace("\0", "");
if (!string.IsNullOrEmpty(prodcode[i]))
{
// 将相邻偶数位和奇数位字符对调
char[] chars = prodcode[i].ToCharArray();
for (int j = 0; j < chars.Length - 1; j += 2)
{
// 交换相邻的两个字符
char temp = chars[j];
chars[j] = chars[j + 1];
chars[j + 1] = temp;
}
prodcode[i] = new string(chars);
_log.Info($"{prodcode[i]}进入产线");
}
}
//connect1.SendValidateUnitsRequest("", traycode, prodcode);
//生成work唯一guid(tid)
@ -120,12 +138,16 @@ namespace Sln.Iot.Business
_log.Info($"预热炉工段开始 ID:{tid}");
});
}
else
{
_log.Error($"PLC读取失败原因1{trayBytesResult.Message} 2{pordBytesResult1.Message} 3{pordBytesResult2.Message}");
}
//流程完成
}
}
else
{
_log.Error("上料提升机PLC读取信号异常");
_log.Error($"上料提升机PLC读取信号异常,原因:{signalRes.Message}");
}
}
catch (Exception ex)

@ -66,7 +66,7 @@ namespace Sln.Iot.Business
//转换托盘码
string traycode = Encoding.ASCII.GetString(trayBytesResult.Content);
traycode = traycode.Replace("\0", "");
_log.Info($"RFID02 [{traycode}]");
_log.Info($"托盘到达-RFID02-托盘号-[{traycode}]");
//sql更新
@ -105,31 +105,35 @@ namespace Sln.Iot.Business
//预热炉数据采集
var data = unitsProcessPLCDataGetBusiness.PreHeatOvenPlcDataGet();
ovenPlcDataService.InsertData(stid, data);
_log.Info($"预热炉数据采集, {data}");
_log.Info($"预热炉数据采集, 预热炉温度:{data}");
//真空箱1数据采集
var data2 = unitsProcessPLCDataGetBusiness.Vacuum1PlcDataGet();
vacuumInjectionPlcDataService.InsertData(stid, data2);
_log.Info($"真空箱1温度数据采集, " +
$"GlueAmountSetValue1:{data2.GlueAmountSetValue1} " +
$"GluePushSpeedSetValue1:{data2.GluePushSpeedSetValue1} " +
$"BarrelA1TempActValue1:{data2.BarrelA1TempActValue1} " +
$"BarrelA2TempActValue1:{data2.BarrelA2TempActValue1} " +
$"BarrelB1TempActValue1:{data2.BarrelB1TempActValue1} " +
$"BarrelB2TempActValue1:{data2.BarrelB2TempActValue1} " +
$"PumpAPressureActValue1:{data2.PumpAPressureActValue1} " +
$"PumpBPressureActValue1:{data2.PumpBPressureActValue1} " +
$"VacuumDegreeActValue1:{data2.VacuumDegreeActValue1} " +
$"PressureHoldTimeSetValue1:{data2.PressureHoldTimeSetValue1}");
_log.Info($"真空箱1温度数据采集\n" +
$"胶量1:{data2.GlueAmountSetValue1}\t" +
$"推胶速度1:{data2.GluePushSpeedSetValue1}\n" +
$"A1温度1:{data2.BarrelA1TempActValue1}\t" +
$"A2温度1:{data2.BarrelA2TempActValue1}\t" +
$"B1温度1:{data2.BarrelB1TempActValue1}\t" +
$"B2温度1:{data2.BarrelB2TempActValue1}\n" +
$"A泵压力1:{data2.PumpAPressureActValue1}\t" +
$"B泵压力1:{data2.PumpBPressureActValue1}\t" +
$"真空度1:{data2.VacuumDegreeActValue1}\t" +
$"保压时间1:{data2.PressureHoldTimeSetValue1}");
});
//CFX
}
else
{
_log.Error($"PLC读取失败原因{trayBytesResult.Message}");
}
//流程完成
}
}
else
{
_log.Error("胶机1真空箱内PLC读取信号异常");
_log.Error($"胶机1真空箱内PLC读取信号异常,原因:{signalRes.Message}");
}
}
catch (Exception ex)

@ -60,7 +60,7 @@ namespace Sln.Iot.Business
//转换托盘码
string traycode = Encoding.ASCII.GetString(trayBytesResult.Content);
traycode = traycode.Replace("\0", "");
_log.Info($"RFID03 [{traycode}]");
_log.Info($"托盘到达-RFID03-托盘号-[{traycode}]");
//sql更新
//取出work唯一guid(tid)
@ -94,12 +94,16 @@ namespace Sln.Iot.Business
_log.Info($"预固炉工段开启, {tid}");
});
}
else
{
_log.Error($"PLC读取失败原因{trayBytesResult.Message}");
}
//流程完成
}
}
else
{
_log.Error("胶机1真空箱外PLC读取信号异常");
_log.Error($"胶机1真空箱外PLC读取信号异常,原因:{signalRes.Message}");
}
}
catch (Exception ex)

@ -66,7 +66,7 @@ namespace Sln.Iot.Business
//转换托盘吗
string traycode = Encoding.ASCII.GetString(trayBytesResult.Content);
traycode = traycode.Replace("\0", "");
_log.Info($"RFID04 [{traycode}]");
_log.Info($"托盘到达-RFID04-托盘号-[{traycode}]");
//sql更新
//取出work唯一guid(tid)
@ -103,13 +103,17 @@ namespace Sln.Iot.Business
//预固炉数据采集
var data = unitsProcessPLCDataGetBusiness.PreCureOvenPlcDataGet();
ovenPlcDataService.UpdateDataPreCure(stid, data);
_log.Info($"预固炉温度数据采集, " +
$"PreCureOven1TempActValue:{data.PreCureOven1TempActValue} " +
$"PreCureOven2TempActValue:{data.PreCureOven2TempActValue} " +
$"PreCureOven3TempActValue:{data.PreCureOven3TempActValue} " +
$"PreCureOven4TempActValue:{data.PreCureOven4TempActValue}");
_log.Info($"预固炉温度数据采集\n" +
$"预固炉1温度:{data.PreCureOven1TempActValue}\t" +
$"预固炉2温度:{data.PreCureOven2TempActValue}\t" +
$"预固炉3温度:{data.PreCureOven3TempActValue}\t" +
$"预固炉4温度:{data.PreCureOven4TempActValue}\n");
});
}
else
{
_log.Error($"PLC读取失败原因{trayBytesResult.Message}");
}
//流程完成
}
// 计算时间差
@ -139,7 +143,7 @@ namespace Sln.Iot.Business
//计算时间差
TimeSpan span = Convert.ToDateTime(time2) - Convert.ToDateTime(nowTime);
spanSecond = (ushort)span.TotalSeconds;
_log.Info($"预固炉时间差" + spanSecond);
_log.Info($"预固炉时间差: [" + spanSecond + "] 秒");
}
res = _plc.PlcWrite(_plc.DeltaInstance2, "D810", spanSecond, DataTypeEnum.UInt16).IsSuccess;
if (!res)
@ -153,12 +157,16 @@ namespace Sln.Iot.Business
_log.Error("胶机2真空箱前时间计算PLC写入完成信号异常");
}
}
else
{
_log.Error($"PLC读取失败原因{trayBytesResult.Message}");
}
//流程完成
}
}
else
{
_log.Error("胶机2真空箱前开始时间读PLC取信号异常");
_log.Error($"胶机2真空箱前开始时间读PLC取信号异常,原因:{signalRes.Message}");
}
}
catch (Exception ex)

@ -68,7 +68,7 @@ namespace Sln.Iot.Business
//转换托盘吗
string traycode = Encoding.ASCII.GetString(trayBytesResult.Content);
traycode = traycode.Replace("\0", "");
_log.Info($"RFID05 [{traycode}]");
_log.Info($"托盘到达-RFID05-托盘号-[{traycode}]");
//sql更新
//取出work唯一guid(tid)
@ -116,42 +116,45 @@ namespace Sln.Iot.Business
unitsData1.VacuumDegreeActValue2 = unitsData2.VacuumDegreeActValue2;
unitsData1.PressureHoldTimeSetValue2 = unitsData2.PressureHoldTimeSetValue2;
connect1.PublishEvent(new CFXEnvelope(unitsProcessedEvent.Handle(tid, cFXUnitProcessedDataGet.ProcessDataGet1(unitsData1))));
_log.Info($"真空箱温度数据上传, " +
$"GlueAmountSetValue1:{unitsData1.GlueAmountSetValue1} " +
$"GluePushSpeedSetValue1:{unitsData1.GluePushSpeedSetValue1} " +
$"BarrelA1TempActValue1:{unitsData1.BarrelA1TempActValue1} " +
$"BarrelA2TempActValue1:{unitsData1.BarrelA2TempActValue1} " +
$"BarrelB1TempActValue1:{unitsData1.BarrelB1TempActValue1} " +
$"BarrelB2TempActValue1:{unitsData1.BarrelB2TempActValue1} " +
$"PumpAPressureActValue1:{unitsData1.PumpAPressureActValue1} " +
$"PumpBPressureActValue1:{unitsData1.PumpBPressureActValue1} " +
$"VacuumDegreeActValue1:{unitsData1.VacuumDegreeActValue1} " +
$"PressureHoldTimeSetValue1:{unitsData1.PressureHoldTimeSetValue1} " +
$"GlueAmountSetValue2:{unitsData1.GlueAmountSetValue2} " +
$"GluePushSpeedSetValue2:{unitsData1.GluePushSpeedSetValue2} " +
$"BarrelA1TempActValue2:{unitsData1.BarrelA1TempActValue2} " +
$"BarrelA2TempActValue2:{unitsData1.BarrelA2TempActValue2} " +
$"BarrelB1TempActValue2:{unitsData1.BarrelB1TempActValue2} " +
$"BarrelB2TempActValue2:{unitsData1.BarrelB2TempActValue2} " +
$"PumpAPressureActValue2:{unitsData1.PumpAPressureActValue2} " +
$"PumpBPressureActValue2:{unitsData1.PumpBPressureActValue2} " +
$"VacuumDegreeActValue2:{unitsData1.VacuumDegreeActValue2} " +
$"PressureHoldTimeSetValue2:{unitsData1.PressureHoldTimeSetValue2}");
_log.Info($"真空箱温度数据上传\n" +
$"胶量1:{unitsData1.GlueAmountSetValue1}\t" +
$"推胶速度1:{unitsData1.GluePushSpeedSetValue1}\n" +
$"A1温度1:{unitsData1.BarrelA1TempActValue1}\t" +
$"A2温度1:{unitsData1.BarrelA2TempActValue1}\t" +
$"B1温度1:{unitsData1.BarrelB1TempActValue1}\t" +
$"B2温度1:{unitsData1.BarrelB2TempActValue1}\n" +
$"A泵压力1:{unitsData1.PumpAPressureActValue1}\t" +
$"B泵压力1:{unitsData1.PumpBPressureActValue1}\t" +
$"真空度1:{unitsData1.VacuumDegreeActValue1}\t" +
$"保压时间1:{unitsData1.PressureHoldTimeSetValue1}\n" +
$"胶量2:{unitsData1.GlueAmountSetValue2}\t" +
$"推胶速度2:{unitsData1.GluePushSpeedSetValue2}\n" +
$"A1温度2:{unitsData1.BarrelA1TempActValue2}\t" +
$"A2温度2:{unitsData1.BarrelA2TempActValue2}\t" +
$"B1温度2:{unitsData1.BarrelB1TempActValue2}\t" +
$"B2温度2:{unitsData1.BarrelB2TempActValue2}\n" +
$"A泵压力2:{unitsData1.PumpAPressureActValue2}\t" +
$"B泵压力2:{unitsData1.PumpBPressureActValue2}\t" +
$"真空度2:{unitsData1.VacuumDegreeActValue2}\t" +
$"保压时间2:{unitsData1.PressureHoldTimeSetValue2}");
});
}
else
{
_log.Error($"PLC读取失败原因{trayBytesResult.Message}");
}
//流程完成
}
}
else
{
_log.Error("胶机2真空箱后PLC读取信号异常");
_log.Error($"胶机2真空箱后PLC读取信号异常,原因:{signalRes.Message}");
}
}
catch (Exception ex)
{
_log.Error("RFID0业务出现异常", ex);
}
}
}
}

@ -78,7 +78,7 @@ namespace Sln.Iot.Business
//转换托盘吗
string traycode = Encoding.ASCII.GetString(trayBytesResult.Content);
traycode = traycode.Replace("\0", "");
_log.Info($"RFID06 [{traycode}]");
_log.Info($"托盘到达-RFID06-托盘号-[{traycode}]");
//sql更新
//取出work唯一guid(tid)
@ -135,24 +135,28 @@ namespace Sln.Iot.Business
unitsdata = ovenPlcDataService.GetData(stid);
connect3.PublishEvent(new CFXEnvelope(unitsProcessedEvent.Handle(tid, cFXUnitProcessedDataGet.ProcessDataGet3(unitsdata))));
_log.Info($"隧道烤箱温度数据上传, " +
$"PreheatOvenTempActValue:{unitsdata.PreheatOvenTempActValue} " +
$"PreCureOven1TempActValue:{unitsdata.PreCureOven1TempActValue} " +
$"PreCureOven2TempActValue:{unitsdata.PreCureOven2TempActValue} " +
$"PreCureOven3TempActValue:{unitsdata.PreCureOven3TempActValue} " +
$"PreCureOven4TempActValue:{unitsdata.PreCureOven4TempActValue} " +
$"CureOven1TempActValue:{unitsdata.CureOven1TempActValue} " +
$"CureOven2TempActValue:{unitsdata.CureOven2TempActValue} " +
$"CureOven3TempActValue:{unitsdata.CureOven3TempActValue} " +
$"CureOven4TempActValue:{unitsdata.CureOven4TempActValue} ");
_log.Info($"隧道烤箱温度数据上传\n" +
$"预热炉温度:{unitsdata.PreheatOvenTempActValue}\n" +
$"预固炉1温度:{unitsdata.PreCureOven1TempActValue}\t" +
$"预固炉2温度:{unitsdata.PreCureOven2TempActValue}\t" +
$"预固炉3温度:{unitsdata.PreCureOven3TempActValue}\t" +
$"预固炉4温度:{unitsdata.PreCureOven4TempActValue}\n" +
$"固化炉1温度:{unitsdata.CureOven1TempActValue}\t" +
$"固化炉2温度:{unitsdata.CureOven2TempActValue}\t" +
$"固化炉3温度:{unitsdata.CureOven3TempActValue}\t" +
$"固化炉4温度:{unitsdata.CureOven4TempActValue}");
});
}
else
{
_log.Error($"PLC读取失败原因{trayBytesResult.Message}");
}
//流程完成
}
}
else
{
_log.Error("下料提升机PLC读取信号异常");
_log.Error($"下料提升机PLC读取信号异常,原因:{signalRes.Message}");
}
}
catch (Exception ex)

@ -118,6 +118,7 @@ public abstract class CFXHelper
//Task.Run(() =>
//{
Endpoint.Publish(env);
_log.Iot($"{Endpoint.CFXHandle}推送事件{env.MessageName}");
//});
}
catch (Exception e)

@ -64,10 +64,15 @@ namespace Sln.Iot.PLC
await Task.WhenAll(tasks);
DeltaInstance0 = tasks[0].GetAwaiter().GetResult();
_log.Info($"PLC连接成功: {DeltaInstance0.IpAddress}");
DeltaInstance1 = tasks[1].GetAwaiter().GetResult();
_log.Info($"PLC连接成功: {DeltaInstance1.IpAddress}");
DeltaInstance2 = tasks[2].GetAwaiter().GetResult();
_log.Info($"PLC连接成功: {DeltaInstance2.IpAddress}");
DeltaInstance3 = tasks[3].GetAwaiter().GetResult();
_log.Info($"PLC连接成功: {DeltaInstance3.IpAddress}");
DeltaInstance4 = tasks[4].GetAwaiter().GetResult();
_log.Info($"PLC连接成功: {DeltaInstance4.IpAddress}");
_log.Info("PLC连接全部成功");
}

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34714.143
# Visual Studio Version 18
VisualStudioVersion = 18.2.11415.280 d18.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sln.Iot", "Sln.Iot\Sln.Iot.csproj", "{2140AD68-D4CE-44EC-B9D3-20D18EB59F9D}"
EndProject
@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sln.Iot.CFX", "Sln.Iot.CFX\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sln.Iot.Model", "Sln.Iot.Model\Sln.Iot.Model.csproj", "{B3E4E8E2-36BE-4EC7-BD7D-F53508468407}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sln.FormTest", "Sln.FormTest\Sln.FormTest.csproj", "{D33C64B6-898E-4AF0-84A6-304071875137}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -75,6 +77,10 @@ Global
{B3E4E8E2-36BE-4EC7-BD7D-F53508468407}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B3E4E8E2-36BE-4EC7-BD7D-F53508468407}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B3E4E8E2-36BE-4EC7-BD7D-F53508468407}.Release|Any CPU.Build.0 = Release|Any CPU
{D33C64B6-898E-4AF0-84A6-304071875137}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D33C64B6-898E-4AF0-84A6-304071875137}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D33C64B6-898E-4AF0-84A6-304071875137}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D33C64B6-898E-4AF0-84A6-304071875137}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -5,25 +5,25 @@
"DeviceName": "Vacuum",
"CFXHandle": "CFX.A00.OT00470018",
"LocalURI": "amqp://127.0.0.1:1235",
"UpperURI": "amqp://127.0.0.1:30031"
"UpperURI": "http://10.148.192.32:8090/sensordata?sensorId=UploadMachineData"
},
"Lift1Config": {
"DeviceName": "Lift1",
"CFXHandle": "CFX.A00.OT00470019",
"LocalURI": "amqp://127.0.0.1:1236",
"UpperURI": "amqp://127.0.0.1:30031"
"UpperURI": "http://10.148.192.32:8090/sensordata?sensorId=UploadMachineData"
},
"OvenConfig": {
"DeviceName": "Oven",
"CFXHandle": "CFX.A00.OT00470017",
"LocalURI": "amqp://127.0.0.1:1237",
"UpperURI": "amqp://127.0.0.1:30031"
"UpperURI": "http://10.148.192.32:8090/sensordata?sensorId=UploadMachineData"
},
"Lift2Config": {
"DeviceName": "Lift2",
"CFXHandle": "CFX.A00.OT00470020",
"LocalURI": "amqp://127.0.0.1:1238",
"UpperURI": "amqp://127.0.0.1:30031"
"UpperURI": "http://10.148.192.32:8090/sensordata?sensorId=UploadMachineData"
}
}
}

Loading…
Cancel
Save