Example #1
0
        public B2MDbGetting(byte[] inbuf, int index)
        {
            int pos = index + 1;

            dbCnt    = inbuf[pos++];
            _DBGroup = new List <DBStruct>(dbCnt);
            for (int i = 0; i < dbCnt; i++)
            {
                DBStruct tmp = new DBStruct();
                tmp.DBID    = inbuf[pos++];
                tmp.DBValue = (uint)(((inbuf[pos++]) << 24) + ((inbuf[pos++]) << 16) + ((inbuf[pos++]) << 8) + (inbuf[pos++]));
                _DBGroup.Add(tmp);
            }
        }
 private void Cal_Button_Click(object sender, RoutedEventArgs e)
 {
     M2BDbSetting dbset = new M2BDbSetting();
     DBStruct tmp = new DBStruct();
     tmp.DBID = _CalPartNo;
     tmp.DBValue = (uint)CalInport1.Value;
     dbset._DBGroup.Add(tmp);
     byte[] sendcmd = dbset.EnCode();
     lock (this)
     {
         comunication.Getinstance().AddtoSend(sendcmd, (byte)sendcmd.Length);
     }
     //MessageBox.Show("SET DB");
 }
 private void temp_Cal(object sender, RoutedEventArgs e)
 {
    
         M2BDbSetting dbset = new M2BDbSetting();
         DBStruct tmp = new DBStruct();
         tmp.DBID = 0x8d;
         tmp.DBValue = (uint)water_temp.Value;
         dbset._DBGroup.Add(tmp);
         byte[] sendcmd = dbset.EnCode();
         lock (this)
         {
             comunication.Getinstance().AddtoSend(sendcmd, (byte)sendcmd.Length);
         }
         MessageBox.Show("Set Temp Finished");
    
 }