示例#1
0
文件: Client.cs 项目: zfrgrbz/snap7
    //-------------------------------------------------------------------------
    // Read a SZL block : ID 0x0011 IDX 0x0000
    //-------------------------------------------------------------------------
    static void ReadSZL_0011_0000()
    {
        S7Client.S7SZL SZL  = new S7Client.S7SZL();
        int            Size = 0x8000;
        int            res  = Client.ReadSZL(0x0011, 0x000, ref SZL, ref Size);

        if (Check(res, "Read SZL - ID : 0x0011, IDX 0x0000"))
        {
            Console.WriteLine("  LENTHDR : " + SZL.Header.LENTHDR.ToString());
            Console.WriteLine("  N_DR    : " + SZL.Header.N_DR.ToString());
            Console.WriteLine("Dump : " + Size.ToString() + " bytes");
            HexDump(SZL.Data, Size);
        }
    }
示例#2
0
        void ReadSZL()
        {
            S7Client.S7SZL SZL  = new S7Client.S7SZL();
            int            Size = 4096; // Declare our Buffer Size

            SZL.Data = new byte[Size];

            label29.Text = "0";
            TxtSZL.Text  = "";

            int Result = Client.ReadSZL(Convert.ToInt32(TxtSZLID.Text), Convert.ToInt32(TxtSZLIndex.Text), ref SZL, ref Size);

            ShowResult(Result);
            if (Result == 0)
            {
                label29.Text = Size.ToString();
                HexDump(TxtSZL, SZL.Data, Size);
            }
        }