gwSuspend (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

4.10 / 1.00.00


Suspends the  RTCU Communication Hub communication.

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

 

Input:        

None.

 

Returns: INT

0

- Success.

3

- RTCU Communication Hub communication is not open.

 

Declaration:

FUNCTION gwSuspend : INT;

 

 


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);
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;