wxw
2025-03-25 01503b2809977ecdab703695c8e4bd70324f3c62
Admin.NET/WCS.Application/PLC/PLCService.cs
@@ -23,6 +23,9 @@
    private static readonly object OLock = new object();
    private static readonly ISqlSugarClient _db = SqlSugarSetup.ITenant.GetConnectionScope(SqlSugarConst.MainConfigId);
    private static decimal weight94 = 0;
    private static decimal weight160 = 0;
    private static decimal weight155 = 0;
    public static void OnChangeEvent(object sender, EventArgs e)
    {
@@ -1192,6 +1195,43 @@
        {
            return;
        }
        #region#实时显示重量到LED屏幕
        var modPosPalletWeightIng = modDevice.listStation.FirstOrDefault(m => m.Text == "实际重量");
        var (resPalletWeightIng, palletWeightValIng) = plcConn.GetPlcDBValue(modPosPalletWeightIng.PosType, modDevice.DbNumber, modPosPalletWeightIng.PlcPos);
        switch (modDevice.StationNum)
        {
            case "094":
                {
                    if (Convert.ToDecimal(palletWeightValIng) != weight94)
                    {
                        LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                        weight94 = Convert.ToDecimal(palletWeightValIng);
                    }
                }
                break;
            case "160":
                {
                    if (Convert.ToDecimal(palletWeightValIng) != weight160)
                    {
                        LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                        weight160 = Convert.ToDecimal(palletWeightValIng);
                    }
                }
                break;
            case "155":
                {
                    if (Convert.ToDecimal(palletWeightValIng) != weight155)
                    {
                        LedDisplay(modDevice.LedIP, $"当前重量(KG):{Convert.ToDecimal(palletWeightValIng)}");
                        weight155 = Convert.ToDecimal(palletWeightValIng);
                    }
                }
                break;
        }
        #endregion
        var ledText = "";
        switch (modDevice.Value.ToString())
        {