예제 #1
0
파일: client.c 프로젝트: jdugge/snap7
//------------------------------------------------------------------------------
// Read a sample SZL Block
//------------------------------------------------------------------------------
void ReadSzl_0011_0000()
{
    PS7SZL SZL = (PS7SZL)(&Buffer);  // use our buffer casted as TS7SZL
    int Size = sizeof(Buffer);
    // Block ID 0x0011 IDX 0x0000 normally exists in every CPU
    int res=Cli_ReadSZL(Client, 0x0011, 0x0000, SZL, &Size);
    if (Check(res,"Read SZL - ID : 0x0011, IDX 0x0000"))
    {
        printf("  LENTHDR : %d\n",SZL->Header.LENTHDR);
        printf("  N_DR    : %d\n",SZL->Header.N_DR);
        printf("Dump (%d bytes) :\n",Size);
        hexdump(&Buffer,Size);
    }
}
예제 #2
0
//---------------------------------------------------------------------------
int TS7Client::ReadSZL(int ID, int Index, PS7SZL pUsrData, int *Size)
{
    return Cli_ReadSZL(Client, ID, Index, pUsrData, Size);
}