Esempio n. 1
0
 /// <summary>
 /// 读内存信息
 /// </summary>
 /// <param name="desAddress"></param>
 /// <param name="sendTime"></param>
 /// <param name="readAddress"></param>
 /// <param name="readLength"></param>
 /// <returns></returns>
 public string SendReadMemory(int desAddress, int sendTime, int readAddress, int readLength)
 {
     myNPDU   = new NPDU(3, 8, readLength, GlobalClass.AddLeftZero(readAddress.ToString("X"), 4), true, sendTime);
     myCEMI   = new CEMI(0x11, 0xbc, 0x60, 0, desAddress);
     myReport = new ReportHeader(10 + myNPDU.Length);
     myHeader = new Header(0x13, myReport.HeadLength + myReport.BodyLength);
     return(myHeader.SetHeader() + myReport.SetReportHeader() +
            myCEMI.SetCEMI() + myNPDU.SetNPDU());
 }
Esempio n. 2
0
 /// <summary>
 /// 读对象值信息
 /// </summary>
 /// <param name="desAddress"></param>
 /// <returns></returns>
 public string SendReadValue(int desAddress)
 {
     myNPDU   = new NPDU(1, 0, 0, "");
     myCEMI   = new CEMI(0x11, 0xbc, 0xe0, 0, desAddress);
     myReport = new ReportHeader(10 + myNPDU.Length);
     myHeader = new Header(0x13, myReport.HeadLength + myReport.BodyLength);
     return(myHeader.SetHeader() + myReport.SetReportHeader() + myCEMI.SetCEMI() + myNPDU.SetNPDU());
 }