CAPL Script

TestWaitForUpdateFlag

Syntax

long TestWaitForUpdateFlag(COValue value, dword timeoutMs)

Function

Waits for the update flag of a communication object value to be set. Each CO value has an update flag which is set when the value is updated and reset through an explicit call tovalueEntity::ClearUpdateFlagorvalueEntity::ResetValueState. Use this function instead ofTestWaitForUpdateif an undetermined number of updates may occur between a point where you reset the flag and a point where at least one update must have occurred.

Parameters

COValue Value of a communication object.

timeoutMS

Timeout in milliseconds.

Return Values

-2: Resume due to constraint violation

-1: General error, for example, functionality is not available

0: Resume due to timeout

1: resume due to event occurred (update flag was set)

long ret;consumedEventRef * anEvent;anEvent = lookupConsumedEvent(path);anEvent.ClearUpdateFlag();// ...ret = testWaitForUpdateFlag(anEvent, 200);

[TestWaitForUpdate](/en/syntax/communication-objects/misc/testwaitforupdate) | [TestWaitForChange](/en/syntax/communication-objects/misc/testwaitforchange) | [TestWaitForChangeFlag](/en/syntax/communication-objects/misc/testwaitforchangeflag)