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