示例#1
0
        public void GetDataSample1()
        {
            Frame645_07 frame = new Frame645_07();

            frame.FAddress.Value = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 };
            frame.FControl.Value = 0x19;
            C19_DataField df = new C19_DataField();

            df.FPassword.PA.Value  = 0x04;
            df.FPassword.PW.Value  = new byte[] { 0x11, 0x22, 0x33 };
            df.FOperatorCode.Value = new byte[] { 0xaa, 0xbb, 0xcc, 0xdd };
            frame.FDataField       = df;

            byte[] data = frame.GetData();
            string str  = String.Join(" ", data.Select(o => o.ToString("X2")));
        }
示例#2
0
        public void GetDataSample()
        {
            Frame645_07 frame = new Frame645_07();

            frame.FAddress.Value = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06 };
            frame.FControl.Value = 0x11;


            //C11_DataField dataFiled = new C11_DataField();
            //dataFiled.FDataIdentifer.Value = new byte[] { 0x01, 0x02, 0x03, 0x04 };
            //dataFiled.FData.Value = new byte[] { 0xAA };
            //frame.FDataField = dataFiled;

            // 下面两行 和 上面注释的内容 起到一样的效果
            OtherDataField odf = new OtherDataField();

            odf.FData.Value  = new byte[] { 0x04, 0x03, 0x02, 0x01, 0xAA };
            frame.FDataField = odf;

            byte[] data = frame.GetData();
        }