CAPL Script

TestWaitForChange

Syntax

long TestWaitForChange(COValue value, dword timeoutMs)

Function

Waits for the next change of a communication object value. This is equivalent to callingTestWaitForChangeCountGreater (value, value.GetChangeCount(), timeoutMs). Note that only changes which occur while the function waits are considered. If you want to wait for changes which may occur earlier, or if you want to wait for several changes, useTestWaitForChangeFlagorTestWaitForChangeCountGreater.

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 (method was called)

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

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