rchSuspend (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

1.54.00


Suspends the communication with the RTCU Communication Hub.

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

 

The rchSuspend function is functionally identical to and interchangeable with the gwSuspend function.

 

Input:        

None.

 

Returns: INT

0

- Success.

3

- The communication is not open.

 

Declaration:

FUNCTION rchSuspend : 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);
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;