gwResume (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

4.10 / 1.00.00


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

This function, in combination with gwSuspend, can be used to control when the RTCU Communication Hub connection should be active.

 

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

To apply a new configuration, use gwClose and gwOpen instead.

 

 

Input:        

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

The number of seconds to remain enabled. Use 0 to keep the RTCU Communication Hub enabled forever.

 

Returns: INT

0

- Success.

3

- RTCU Communication Hub communication is not open.

4

- RTCU Communication Hub communication is not suspended.

6

- Invalid time.

 

Declaration:

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

 

Example:

INCLUDE rtcu.inc
PROGRAM test;
VAR
 last_hour : SINT := -1;
 clock     : clockGet;
END_VAR;
gsmPower(power := TRUE);
gprsOpen();
// Suspend connection
gwSuspend();
BEGIN
  clock();
  // Once every hour
  IF clock.Hour <> last_hour THEN
    last_hour := clock.hour;
     // Connect for 5 minutes
    gwResume(time:=5*60);
  END_IF;
   
  Sleep(delay:=5000);
END;
END_PROGRAM;