Skip to main content
Version: v4 (Stable)

RECEIVEALARM

RECEIVEALARM(alarm AS INTEGER BYREF, message AS STRING BYREF [, timeout AS INTEGER]) AS INTEGER

Waits for reception of status of alarm <alarm> during the maximum time of <timeout> milliseconds.

If the value of the <alarm> parameter is null, the first status of any alarm is returned.

If the optional parameter <timeout> is null (default value), the function returns the possibly received status without waiting. If <timeout> is equal to -1, the function waits for an alarm status without time limitation.

If an alarm status is received, the function copies the alarm message in the variable <message>, sets the parameter <alarm> with the alarm identifier and returns the alarm status: 1=alarm, 2=reset, 3=acknowledgment.

If no alarm status is received after timeout, the function returns 0.

If the communication is aborted during wait, the function returns -1.