diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BasePlcHelper.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BasePlcHelper.cs index 2e9f966..5eb0437 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BasePlcHelper.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/BasePlcHelper.cs @@ -3116,5 +3116,10 @@ namespace Mesnac.Action.ChemicalWeighing + public DataKeyValue test { get; set; } + public DataKeyValue tst0 { get; set; } + public DataKeyValue tst1 { get; set; } + public DataKeyValue tst2 { get; set; } + } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs index 3331fc6..11b5990 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs @@ -52,9 +52,53 @@ namespace Mesnac.Action.ChemicalWeighing.Test // var read = BasePlcHelper.Instance.PlcRead(instanceRecipeName0, out int[] ss); - // var firstWordNowValue = BasePlcHelper.Instance.FirstWord.NowValue.ToInt(); - var plcRead = BasePlcHelper.Instance.PlcRead("ParametersWithPc", "1165", 0, 1, out short[] ssss); - // + //192.168.153.100 + var firstWordNowValue = BasePlcHelper.Instance.test; + var a = BasePlcHelper.Instance.tst0; + var b = BasePlcHelper.Instance.tst1; + var bs = BasePlcHelper.Instance.tst2; + + var bo = BasePlcHelper.Instance.PlcRead("ParametersWithPc", "3", 0, 1, out short[] aaaaa); + var aa = Mesnac.Basic.DataProcessor.Swap(aaaaa[0]); //注意:西门子PLC需要高低位转换 + var qq = Convert.ToBoolean(aa); + // + // + // + // + // var aa = Mesnac.Basic.DataProcessor.Swap(aaaaa[0]); //注意:西门子PLC需要高低位转换 + // + // var bytesa = BitConverter.GetBytes(aa); + // + // bool[] bitsa = new bool[8]; + // + // for (int i = 0; i < 8; i++) + // { + // bitsa[i] = (bytesa[0] & (1 << i)) != 0; + // } + + + var plcReadds = BasePlcHelper.Instance.PlcRead("ParametersWithPc", "3", 1, 1, out short[] bbbb); + var bSwap = Mesnac.Basic.DataProcessor.Swap(bbbb[0]); //注意:西门子PLC需要高低位转换 + + var bytesa = BitConverter.GetBytes(bSwap); + + bool[] bits = new bool[8]; + + for (int i = 0; i <8; i++) + { + bits[i] = (bytesa[0] & (1 << i)) != 0; + + } + bool[] bits2 = new bool[8]; + + for (int i = 0; i <8; i++) + { + bits2[i] = (bytesa[1] & (1 << i)) != 0; + + } + + var ss = "asdf"; + // // short test = ssss[0]; // var bytes = BitConverter.GetBytes(test); @@ -63,8 +107,9 @@ namespace Mesnac.Action.ChemicalWeighing.Test // DataKeyValue dataKeyRecipePause = new DataKeyValue("RecipePause"); // - // bool Save3thActs = BasePlcHelper.Instance.PlcRead(dataKeyRecipePause, out int[] ghPcSave3ThActs); - // var swap = DataProcessor.Swap(ghPcSave3ThActs[0]); + + // var swap = DataProcessor.Swap(ghPcSave3ThActs[0]); + // DataProcessor.ParseBinaryValue() // var recipePause = BasePlcHelper.Instance.RecipePause.NowValue.ToInt(); @@ -85,11 +130,11 @@ namespace Mesnac.Action.ChemicalWeighing.Test //256 default-bit(1,1) - DbMCControl binGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "MCLabel153").FirstOrDefault(); - - - var comboBox1 = base.GetControlById("MCButton1") as System.Windows.Forms.Button; - var comboBox1s = base.GetControlById("MCButton1") as Mesnac.Controls.Default.Button; + // DbMCControl binGridControl = this.GetDbMCControlByKey(Mesnac.Basic.DataSourceFactory.MCDbType.Local, "MCLabel153").FirstOrDefault(); + // + // + // var comboBox1 = base.GetControlById("MCButton1") as System.Windows.Forms.Button; + // var comboBox1s = base.GetControlById("MCButton1") as Mesnac.Controls.Default.Button; // List mcControllist = GetAllDbMCControlsByOption(DbOptionTypes.Query);//获取所有待初始化控件 // IBaseControl startdate = mcControllist.Where(t => t.BaseControl.MCKey != null && t.BaseControl.MCKey.ToLower() == "startdate").FirstOrDefault().BaseControl; @@ -105,7 +150,7 @@ namespace Mesnac.Action.ChemicalWeighing.Test - ShowMsg("小料Action事件测试", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + ShowMsg("小料Action1事件测试", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } diff --git a/Main/MCEdit/Data/MCProject/nodeDevice.xml b/Main/MCEdit/Data/MCProject/nodeDevice.xml index 25b7bf4..a37df5d 100644 --- a/Main/MCEdit/Data/MCProject/nodeDevice.xml +++ b/Main/MCEdit/Data/MCProject/nodeDevice.xml @@ -142,8 +142,7 @@ - - + @@ -188,7 +187,6 @@ - @@ -209,8 +207,7 @@ - - + @@ -255,8 +252,7 @@ - - + @@ -276,7 +272,6 @@ - @@ -352,8 +347,6 @@ - - @@ -454,8 +447,6 @@ - - @@ -2641,7 +2632,6 @@ - @@ -2662,1112 +2652,1110 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -7709,6 +7697,14 @@ + + + + + + + + \ No newline at end of file diff --git a/Main/MCEdit/Data/MCProject/nodeForm/Form1.xml b/Main/MCEdit/Data/MCProject/nodeForm/Form1.xml index ca2715b..ad40a1c 100644 --- a/Main/MCEdit/Data/MCProject/nodeForm/Form1.xml +++ b/Main/MCEdit/Data/MCProject/nodeForm/Form1.xml @@ -15,6 +15,10 @@ 56, 26 + + + + 419, 617 ThreeWayValve2 101, 51 @@ -48,6 +52,10 @@ 13, 13 + + + + 211, 599 ThreeWayValve1 56, 60 @@ -633,7 +641,7 @@ - AAEAAAD/////AQAAAAAAAAAMAgAAAEt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