예제 #1
0
 public override void SetCreate(ref ECMsg m, int gquant, uint rawdata)
 {
     m.SetUp('S', 6, 1);
     m.ReqMsg[0] = 4;                                             // length
     Msger.AddGroup(m.K.Group.Num, out m.ReqMsg[1], out m.ReqMsg[2]);
     Msger.AddData(myItem.Num, out m.ReqMsg[3], out m.ReqMsg[4]); // Opcode is myItem.Num
     m.ReqMsg[5]  = Msger.Chksum(m.ReqMsg);
     m.RplyMsg[0] = 0;                                            // clear reply for safety
 }
 /// <summary>
 /// Use _xbf* to calc checksum and fill in results.
 /// </summary>
 private void Rx_TestCS()
 {
     if (_xbf[_xbf_i - 1] == Msger.Chksum(_xbf, _xbf_i_lenpos))
     {
         _xbf_stat = 'C';
     }
     else
     {
         _xbf_stat = 'K';
     }
 }
 public override void GetCreate(ref ECMsg m, int gquant)
 {
     m.SetUp('G', 10, 1 + (gquant * 14));
     m.ReqMsg[0] = 8;                                             // length
     Msger.AddGroup(m.K.Group.Num, out m.ReqMsg[1], out m.ReqMsg[2]);
     Msger.AddData(0xB005, out m.ReqMsg[3], out m.ReqMsg[4]);     // Opcode
     Msger.AddHost(myAxis, out m.ReqMsg[5], out m.ReqMsg[6]);     // host/relay axis
     Msger.AddData(myItem.Num, out m.ReqMsg[7], out m.ReqMsg[8]); // Address is myItem.Num
     m.ReqMsg[9]  = Msger.Chksum(m.ReqMsg);
     m.RplyMsg[0] = 0;                                            // clear reply for safety
 }
 public override void SetCreate(ref ECMsg m, int gquant, uint rawdata)
 {
     m.SetUp('S', 12, 1);
     m.ReqMsg[0] = 10;                                            // length
     Msger.AddGroup(m.K.Group.Num, out m.ReqMsg[1], out m.ReqMsg[2]);
     Msger.AddData(0x9005, out m.ReqMsg[3], out m.ReqMsg[4]);     // Opcode
     Msger.AddData(myItem.Num, out m.ReqMsg[5], out m.ReqMsg[6]); // Address is myItem.Num
     Msger.AddData(rawdata, out m.ReqMsg[9], out m.ReqMsg[10], out m.ReqMsg[7], out m.ReqMsg[8]);
     m.ReqMsg[11] = Msger.Chksum(m.ReqMsg);
     m.RplyMsg[0] = 0;  // clear reply for safety
 }
 public override void SetCreate(ref ECMsg m, uint rawdata)
 {
     m.SetUp('S', 10, 1);
     m.ReqMsg[0] = 8;                                             // length
     Msger.AddAxis(m.K.Axis.Num, out m.ReqMsg[1], out m.ReqMsg[2]);
     Msger.AddData(0x9004, out m.ReqMsg[3], out m.ReqMsg[4]);     // Opcode
     Msger.AddData(myItem.Num, out m.ReqMsg[5], out m.ReqMsg[6]); // Address is myItem.Num
     Msger.AddData(rawdata, out m.ReqMsg[7], out m.ReqMsg[8]);
     m.ReqMsg[9]  = Msger.Chksum(m.ReqMsg);
     m.RplyMsg[0] = 0;  // clear reply for safety
 }
 public override void GetRawdata(ref ECMsg m, int offsetinrply, out uint rawdata)
 {
     rawdata = Msger.RemData(m.RplyMsg[offsetinrply + 11], m.RplyMsg[offsetinrply + 12], m.RplyMsg[offsetinrply + 9], m.RplyMsg[offsetinrply + 10]);
 }