rchResume (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

1.54.00


Resumes the communication with the RTCU Communication Hub, and optionally suspends it again after a time interval.

This function, in combination with rchSuspend, can be used to control when the connection should be active.

 

Please note that changes to the configuration will NOT be applied when resuming the connection.

To apply a new configuration, use rchClose and rchOpen instead.

 

The rchResume function is functionally identical to and interchangeable with the gwResume function.

 

 

Input:        

time : DINT (0..2147483647) (Default 0)

The number of seconds to remain enabled. Use 0 to keep the connection enabled forever.

 

Returns: INT

0

- Success.

3

- The communication is not open.

4

- The communication is not suspended.

6

- Invalid time.

 

Declaration:

FUNCTION rchResume : INT;
VAR_INPUT
   time : DINT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
PROGRAM test;
VAR
  last_hour : SINT := -1;
  clock     clockGet;
END_VAR;
// Turn on power to the GSM module
gsmPower(power := TRUE);
netOpen(iface:=1);
 
// Suspend connection
rchSuspend();
 
BEGIN
   clock();
   // Once every hour
   IF clock.Hour <> last_hour THEN
      last_hour := clock.hour;
      // Connect for 5 minutes
      rchResume(time:=5*60);
   END_IF;
    
   Sleep(delay:=5000);
END;
END_PROGRAM;