gsmSignalLevel (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

All

Firmware version:

1.00 / 1.00.00


This function returns the signal strength of the GSM base station it is received with. The returned value will either be the real signal strength (expressed in dBm, between -113 and -51) or as a percentage (between 0 and 100). If the input parameter "dbm" is set to false (this is the default), the function will return the signal strength as a percentage. Please note that the signal level is logarithmic in nature and that the value in percentage is just a linear representation of the real signal level from -113 to -51 dBm. 10 dB (which is 10 times the RF power) of extra signal will only give an extra percentage reading of 16.

 

It will return 0 if the GSM module is powered off or if the GSM module is temporarily busy

 

 

Input:

dbm : BOOL (default: FALSE)

         

Returns: SINT (0..100 or -113..-51)

Signal level of base station (0 if the GSM module is powered off or if the GSM module is temporarily busy).

 

Declaration:

FUNCTION gsmSignalLevel : SINT;
VAR_INPUT
  dbm : BOOL := FALSE;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  level : SINT;
END_VAR;
 
BEGIN
  ...
  // Get signallevel in % (from 0 to 100)
  level := gsmSignalLevel();
  ...
END;
 
END_PROGRAM;