rchHeartBeat (Function)

Top  Previous  Next

Architecture:

NX32 / NX32L

Device support:

All

Firmware version:

5.12 / 1.70.00


Calling this function will enable the heartbeat functionality supported by the RTCU Communication Hub.

UDP/IP heartbeat packages will be sent to the RTCU Communication Hub in accordance with the parameters specified when calling this function.

 
This functionality will notify an RTCU Communication Hub plug-in with corresponding "heartbeat offline" and "heartbeat online" events.

Please refer to the RTCU Communication Hub for more information.

 
Using this Heartbeat functionality allows very fast detection of a device that goes offline/online for example when the quality of the cellular connection is suboptimal.

 

The 'freq' is how often the Heartbeat should be sent. The 'timeout' is the maximum time without a heartbeat received by the RTCU Communication Hub until the device is considered offline.
 

 

Input:        

timeout : UINT (default 0)

Timeout in seconds. Specifying a value of 0 will use a value that is two-times the self-transaction frequency.

 
freq : USINT (default 0)

The frequency of the heartbeat in seconds. Specifying 0 will disable the heartbeat.

 

Returns:INT

1

- Success.

0

- Not supported.

-1

- The timeout must be larger than the frequency.

 

 

Declaration:

FUNCTION rchHeartBeat;
VAR_INPUT
  timeout              : UINT := 0;

  freq                 : USINT := 0;

END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
rchHeartBeat(timeout:=30,freq:=10);

BEGIN
  ...
END;
END_PROGRAM;