コード例 #1
0
ファイル: client.c プロジェクト: jdugge/snap7
//------------------------------------------------------------------------------
// Async Upload DB0 (using callback as completion trigger)
//------------------------------------------------------------------------------
void AsCBUploadDB0()
{
    int Size = sizeof(Buffer); // Size is IN/OUT par
    // In input it tells the client the size available
    // In output it tells us how many bytes were uploaded.
    int res;
    JobDone=false;

    res=Cli_AsUpload(Client, Block_SDB, 0, &Buffer, &Size);

    if (res==0)
    {
        while (!JobDone)
        {
            SysSleep(100);
        }
        res=JobResult;
    }

    if (Check(res,"Async (callback) Block Upload (SDB 0)"))
    {
        printf("Dump (%d bytes) :\n",Size);
        hexdump(&Buffer,Size);
    }
}
コード例 #2
0
ファイル: client.c プロジェクト: jdugge/snap7
//------------------------------------------------------------------------------
// Async Upload DB0 (using event wait as completion trigger)
//------------------------------------------------------------------------------
void AsEWUploadDB0()
{
    int Size = sizeof(Buffer); // Size is IN/OUT par
    // In input it tells the client the size available
    // In output it tells us how many bytes were uploaded.
    int res;
    JobDone=false;

    res=Cli_AsUpload(Client, Block_SDB, 0, &Buffer, &Size);

    if (res==0)
    {
        res=Cli_WaitAsCompletion(Client,3000);
    }

    if (Check(res,"Async (Wait event) Block Upload (SDB 0)"))
    {
        printf("Dump (%d bytes) :\n",Size);
        hexdump(&Buffer,Size);
    }
}
コード例 #3
0
ファイル: client.c プロジェクト: jdugge/snap7
//------------------------------------------------------------------------------
// Async Upload DB0 (using polling as completion trigger)
//------------------------------------------------------------------------------
void AsPOUploadDB0()
{
    int Size = sizeof(Buffer); // Size is IN/OUT par
    // In input it tells the client the size available
    // In output it tells us how many bytes were uploaded.
    int res;
    JobDone=false;

    res=Cli_AsUpload(Client, Block_SDB, 0, &Buffer, &Size);

    if (res==0)
    {
        while (Cli_CheckAsCompletion(Client,&res)!=JobComplete)
        {
            SysSleep(100);
        };
    }

    if (Check(res,"Async (polling) Block Upload (SDB 0)"))
    {
        printf("Dump (%d bytes) :\n",Size);
        hexdump(&Buffer,Size);
    }
}
コード例 #4
0
ファイル: snap7.cpp プロジェクト: JanczuraPiotr/snap7
//---------------------------------------------------------------------------
int TS7Client::AsUpload(int BlockType, int BlockNum, void *pUsrData, int *Size)
{
    return Cli_AsUpload(Client, BlockType, BlockNum, pUsrData, Size);
}