TestAction

master
nodyang 1 year ago
parent 7cd2db0e45
commit e068ae7bb0

@ -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; }
}
}

@ -52,8 +52,52 @@ 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]);
// DataProcessor.ParseBinaryValue()
// var recipePause = BasePlcHelper.Instance.RecipePause.NowValue.ToInt();
@ -85,11 +130,11 @@ namespace Mesnac.Action.ChemicalWeighing.Test
//256 default-bit(11
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<DbMCControl> 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);
}

@ -142,7 +142,6 @@
<Data name="presDay_B4_ActualValue" runname="presDay_B4_ActualValue" start="132" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="实际值,用于显示" />
<Data name="presDay_B4_LowLimit" runname="presDay_B4_LowLimit" start="134" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="低压压定值" />
<Data name="presDay_B4_HighLimit" runname="presDay_B4_HighLimit" start="136" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="高压压定值" />
<Data name="presDay_B4_Alarm" runname="presDay_B4_Alarm" start="138" len="1" method="Default_Bit(0,1)" max="" issave="False" subtractor="" remark="超压压警" />
<Data name="presDay_B5_ActualValue" runname="presDay_B5_ActualValue" start="139" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="实际值,用于显示" />
<Data name="presDay_B5_LowLimit" runname="presDay_B5_LowLimit" start="141" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="低压压定值" />
@ -188,7 +187,6 @@
<Data name="PR2PCP03_B12_LowLimit" runname="PR2PCP03_B12_LowLimit" start="211" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="低压压定值" />
<Data name="PR2PCP03_B12_HighLimit" runname="PR2PCP03_B12_HighLimit" start="213" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="高压压定值" />
<Data name="PR2PCP03_B12_Alarm" runname="PR2PCP03_B12_Alarm" start="215" len="1" method="Default_Bit(0,1)" max="" issave="False" subtractor="" remark="超压压警" />
<Data name="Hopper1_ActWeight" runname="Hopper1_ActWeight" start="216" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="实实重量" />
<Data name="Hopper1_HighWeight" runname="Hopper1_HighWeight" start="218" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="高料位重量" />
<Data name="Hopper1_LowWeight" runname="Hopper1_LowWeight" start="220" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="低料位重量" />
@ -209,7 +207,6 @@
<Data name="Hopper4_LowWeight" runname="Hopper4_LowWeight" start="241" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="低料位重量" />
<Data name="Hopper4_HighLevel" runname="Hopper4_HighLevel" start="243" len="1" method="Default_Bit(0,1)" max="" issave="False" subtractor="" remark="高料位指示" />
<Data name="Hopper4_LowLevel" runname="Hopper4_LowLevel" start="243" len="1" method="Default_Bit(1,1)" max="" issave="False" subtractor="" remark="低料位指示" />
<Data name="Vessel1_ActWeight" runname="Vessel1_ActWeight" start="244" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="实实重量" />
<Data name="Vessel1_HighWeight" runname="Vessel1_HighWeight" start="246" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="高料位重量" />
<Data name="Vessel1_LowWeight" runname="Vessel1_LowWeight" start="248" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="低料位重量" />
@ -255,7 +252,6 @@
<Data name="WScale4_LowWeight" runname="WScale4_LowWeight" start="304" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="低料位重量" />
<Data name="WScale4_HighLevel" runname="WScale4_HighLevel" start="306" len="1" method="Default_Bit(0,1)" max="" issave="False" subtractor="" remark="高料位指示" />
<Data name="WScale4_LowLevel" runname="WScale4_LowLevel" start="306" len="1" method="Default_Bit(1,1)" max="" issave="False" subtractor="" remark="低料位指示" />
<Data name="conveyV1_PV" runname="conveyV1_PV" start="307" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="" />
<Data name="conveyV1_SV" runname="conveyV1_SV" start="309" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="" />
<Data name="purgeV1_PV" runname="purgeV1_PV" start="311" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="" />
@ -276,7 +272,6 @@
<Data name="conveyV5_SV" runname="conveyV5_SV" start="341" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="" />
<Data name="purgeV5_PV" runname="purgeV5_PV" start="343" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="" />
<Data name="purgeV5_SV" runname="purgeV5_SV" start="345" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="" />
<Data name="weightPraSilo0_HighSpeed" runname="weightPraSilo0_HighSpeed" start="347" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="高速频率" />
<Data name="weightPraSilo0_LowSpeed" runname="weightPraSilo0_LowSpeed" start="349" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="低速频率" />
<Data name="weightPraSilo0_WeightSlow" runname="weightPraSilo0_WeightSlow" start="351" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="快慢值值值" />
@ -352,8 +347,6 @@
<Data name="weightPraSilo14_WeightSlow" runname="weightPraSilo14_WeightSlow" start="477" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="快慢值值值" />
<Data name="weightPraSilo14_Precut" runname="weightPraSilo14_Precut" start="479" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="提前值" />
<Data name="weightPraSilo14_JogTime" runname="weightPraSilo14_JogTime" start="481" len="1" method="Default_ShortDiv()" max="" issave="False" subtractor="" remark="点动动动" />
<Data name="Daybin0_HighSpeed" runname="Daybin0_HighSpeed" start="482" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="高速频率" />
<Data name="Daybin0_LowSpeed" runname="Daybin0_LowSpeed" start="484" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="低速频率" />
<Data name="Daybin0_WeightSlow" runname="Daybin0_WeightSlow" start="486" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="快慢值值值" />
@ -454,8 +447,6 @@
<Data name="Water3_WeightSlow" runname="Water3_WeightSlow" start="657" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="快慢值值值" />
<Data name="Water3_Precut" runname="Water3_Precut" start="659" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="提前值" />
<Data name="Water3_JogTime" runname="Water3_JogTime" start="661" len="1" method="Default_ShortDiv()" max="" issave="False" subtractor="" remark="点动动动" />
<Data name="SpeedD1" runname="SpeedD1" start="662" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="干混机手动速度 D1" />
<Data name="SpeedD2" runname="SpeedD2" start="664" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="干混机手动速度 D2" />
<Data name="SpeedD3" runname="SpeedD3" start="666" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="干混机手动速度 D3" />
@ -2641,7 +2632,6 @@
<Data name="enableDB_B12" runname="enableDB_B12" start="26" len="1" method="Default_Bit(11,1)" max="" issave="False" subtractor="" remark="12#日罐使能" />
<Data name="enableWater_S1" runname="enableWater_S1" start="26" len="1" method="Default_Bit(12,1)" max="" issave="False" subtractor="" remark="第一组水秤使能" />
<Data name="enableWater_S2" runname="enableWater_S2" start="26" len="1" method="Default_Bit(13,1)" max="" issave="False" subtractor="" remark="第二组水秤使能" />
<Data name="enableDryD1" runname="enableDryD1" start="26" len="1" method="Default_Bit(14,1)" max="" issave="False" subtractor="" remark="1#干混机使能" />
<Data name="enableDryD2" runname="enableDryD2" start="26" len="1" method="Default_Bit(15,1)" max="" issave="False" subtractor="" remark="2#干混机使能" />
<Data name="enableDryD3" runname="enableDryD3" start="27" len="1" method="Default_Bit(0,1)" max="" issave="False" subtractor="" remark="3#干混机使能" />
@ -2662,7 +2652,6 @@
<Data name="enableDryM6" runname="enableDryM6" start="27" len="1" method="Default_Bit(15,1)" max="" issave="False" subtractor="" remark="6#湿混机使能" />
<Data name="enableDryM7" runname="enableDryM7" start="28" len="1" method="Default_Bit(0,1)" max="" issave="False" subtractor="" remark="7#湿混机使能" />
<Data name="enableDryM8" runname="enableDryM8" start="28" len="1" method="Default_Bit(1,1)" max="" issave="False" subtractor="" remark="8#湿混机使能" />
<Data name="DryerD1Recip0_Bin" runname="DryerD1Recip0_Bin" start="29" len="1" method="Default_ShortDiv()" max="" issave="False" subtractor="" remark="罐号" />
<Data name="DryerD1Recip0_Set" runname="DryerD1Recip0_Set" start="30" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="设定重量" />
<Data name="DryerD1Recip0_Tolerance" runname="DryerD1Recip0_Tolerance" start="32" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="公差" />
@ -3767,7 +3756,6 @@
<Data name="Weter_M8Step9_mixSpeed" runname="Weter_M8Step9_mixSpeed" start="1783" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="速度" />
<Data name="Weter_M8Step9_setValue" runname="Weter_M8Step9_setValue" start="1785" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="设定重量" />
<Data name="Weter_M8Step9_tolerance" runname="Weter_M8Step9_tolerance" start="1787" len="2" method="Default_Float()" max="" issave="False" subtractor="" remark="设定公差" />
</Data>
</Group>
<Group name="DB2102-valveInitDB" block="2102" start="0" len="92" access="ReadWrite" remark="valveInitDB" isautoread="False">
@ -7709,6 +7697,14 @@
<Data name="LSiloO" runname="LSiloO" start="1" len="1" method="Default_Bit(11,1)" max="" issave="True" subtractor="" remark="" />
</Data>
</Group>
<Group name="Tst3" block="3" start="0" len="2" access="ReadWrite" remark="" isautoread="True">
<Data>
<Data name="test" runname="test" start="0" len="1" method="Default_Bit(0,1)" max="" issave="True" subtractor="" remark="" />
<Data name="tst0" runname="tst0" start="1" len="1" method="Default_Bit(0,1)" max="" issave="False" subtractor="" remark="" />
<Data name="tst1" runname="tst1" start="1" len="1" method="Default_Bit(1,1)" max="" issave="True" subtractor="" remark="" />
<Data name="tst2" runname="tst2" start="1" len="1" method="Default_Bit(2,1)" max="" issave="True" subtractor="" remark="" />
</Data>
</Group>
</Group>
</Equip>
</EquipFactory>

@ -15,6 +15,10 @@
<Property name="Size">56, 26</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.ThreeWayValve, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="ThreeWayValve2" children="Controls">
<Property name="ZLTName" />
<Property name="ZLDName" />
<Property name="ALMTName" />
<Property name="ALMDName" />
<Property name="Location">419, 617</Property>
<Property name="Name">ThreeWayValve2</Property>
<Property name="Size">101, 51</Property>
@ -48,6 +52,10 @@
<Property name="Size">13, 13</Property>
</Object>
<Object type="Mesnac.Controls.ChemicalWeighing.ThreeWayValve, Mesnac.Controls.ChemicalWeighing, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="ThreeWayValve1" children="Controls">
<Property name="ZLTName" />
<Property name="ZLDName" />
<Property name="ALMTName" />
<Property name="ALMDName" />
<Property name="Location">211, 599</Property>
<Property name="Name">ThreeWayValve1</Property>
<Property name="Size">56, 60</Property>
@ -633,7 +641,7 @@
</Object>
<Object type="Mesnac.Controls.Default.MCButton, Mesnac.Controls.Default, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" name="MCButton1" children="Controls">
<Property name="ClickActionList">
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAEAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIDNBRjJGRDJBM0Q4MDQ2RTFBNzRCQUFFRUY4MTA4Q0JGBgYAAAAS5bCP5paZQWN0aW9u5rWL6K+VBgcAAAAS5bCP5paZQWN0aW9u5rWL6K+VCw==</Binary>
<Binary>AAEAAAD/////AQAAAAAAAAAMAgAAAEtNZXNuYWMuQ29udHJvbHMuQmFzZSwgVmVyc2lvbj0xLjAuMC4wLCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPW51bGwEAQAAAJMBU3lzdGVtLkNvbGxlY3Rpb25zLkdlbmVyaWMuTGlzdGAxW1tNZXNuYWMuQ29udHJvbHMuQmFzZS5EZXNpZ25BY3Rpb24sIE1lc25hYy5Db250cm9scy5CYXNlLCBWZXJzaW9uPTEuMC4wLjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibGljS2V5VG9rZW49bnVsbF1dAwAAAAZfaXRlbXMFX3NpemUIX3ZlcnNpb24EAAAjTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uW10CAAAACAgJAwAAAAEAAAAGAAAABwMAAAAAAQAAAAQAAAAEIU1lc25hYy5Db250cm9scy5CYXNlLkRlc2lnbkFjdGlvbgIAAAAJBAAAAA0DBQQAAAAhTWVzbmFjLkNvbnRyb2xzLkJhc2UuRGVzaWduQWN0aW9uAwAAABU8R1VJRD5rX19CYWNraW5nRmllbGQVPE5hbWU+a19fQmFja2luZ0ZpZWxkFzxSZW1hcms+a19fQmFja2luZ0ZpZWxkAQEBAgAAAAYFAAAAIDNBRjJGRDJBM0Q4MDQ2RTFBNzRCQUFFRUY4MTA4Q0JGBgYAAAAS5bCP5paZQWN0aW9u5rWL6K+VBgcAAAAS5bCP5paZQWN0aW9u5rWL6K+VCw==</Binary>
</Property>
<Property name="MCKey">MCLabel153</Property>
<Property name="MCDataSourceID" />
@ -652,7 +660,7 @@
<Property name="Text">MCButton1</Property>
<Property name="Location">505, 364</Property>
<Property name="Name">MCButton1</Property>
<Property name="Size">75, 23</Property>
<Property name="Size">161, 178</Property>
<Property name="TabIndex">66</Property>
</Object>
<Object type="System.Windows.Forms.Panel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="Panel2" children="Controls">

Loading…
Cancel
Save