gprsSetMonitorParm (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

2.60 / 1.00.00


This function will set the parameters for the mobile network monitoring service.

The mobile network monitor will periodically check the health of the mobile network connection and automatically take the necessary recovery actions required to reestablish service.

Use of the mobile network monitoring service is only recommended in applications where the RTCU Communication Hub is not in use - such as pure FTP / SMTP applications. When using the RTCU Communication Hub, the health of the connection is automatically monitored with the periodic self-transaction.

 

The parameters for the mobile network monitoring service are non-volatile and therefore need only to be set once. Parameters take effect after a device resets (by using, for example, the boardReset function).

 

The parameter set by gprsSetMonitorParm can be read by using gprsGetMonitorParm.

 

Please note that this function is deprecated, please use the netSetMonitorParam function instead.

 

 

Input:

Enabled : BOOL

Determines whether the mobile network monitor service is enabled.

 

MaxAttempt : INT (1..60, default 3)

Maximum number of check attempts before mobile network recovery actions are initiated.

Recommended is 3 times.

 

AliveFreq : DINT (30..60000 seconds, default 300)

Frequency for checking the mobile network connection in seconds.

With this frequency, the connection will be checked "MaxAttempt" times before mobile network recovery actions are initiated.

Recommended alive-frequency is 300 seconds.

 

 

Returns:

None.

 

 

Declaration:

FUNCTION gprsSetMonitorParm;
VAR_INPUT
  Enabled   : BOOL;
  MaxAttempt : INT := 3;
  AliveFreq : DINT := 300;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  gprscfg : gprsGetMonitorParm;
END_VAR;
 
// Check settings
gprscfg();
IF NOT gprscfg.Enabled OR gprscfg.MaxAttempt <> 3 OR gprscfg.AliveFreq <> 180 THEN
  // Set mobile network monitor parameters
  gprsSetMonitorParm(Enabled := TRUE, AliveFreq := 180);
  boardReset();
END_IF;
 
// Turn on power to the GSM module
gsmPower(power := ON);
gprsOpen();
 
BEGIN
  ...
END;
END_PROGRAM;