navSensorUpdate (Function)

Top  Previous  Next

Architecture:

NX32 / NX32L

Device support:

MX2 turbo/encore/warp, AX9 turbo, NX-200, NX-400, NX-900, LX2, LX4, LX5

Firmware version:

4.70 / 1.30.00

Nav. API level:

17


This function will update the status of a sensor on the display of the navigation unit.

 

 

 

Input:

id : INT

Unique ID to identify the sensor to update.

 

severity : SINT (0..2, default: 0)

The severity of the sensor status:

0

- Normal

1

- Medium

2

- High

 

play_sound : BOOL (default FALSE)

Set to true to play a sound when the update is received.

 

log_status : BOOL (default FALSE)

Set to true to store this update in the history of the sensor.

 

status : STRING

The new status of the sensor. Max. 79 characters.

 

desc : STRING

The description for the status. Max. 109 characters.

 

 

Returns: INT

0

- Success.

-1

- Navigation interface is not open.

-2

- Error communicating with navigation device.

-3

- The sensor could not be found.

-4

- The navigation device rejected the command.

-8

- Invalid parameter.

-11

- Sensor display is not supported.

-12

- Navigation interface is busy.

 

Declaration:

FUNCTION navSensorUpdate : INT;
VAR_INPUT
  ID         : DINT;
  severity   : SINT := 0;
  play_sound : BOOL := FALSE;
  log_status : BOOL := FALSE;
  status     : STRING;
  desc       : STRING;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM NavigationExample;
 
BEGIN
  ...
  // Create sensor 55
  navSensorConfig(ID := 55, name := "Temperature", icon := 3);
  ...
  // Set the value of the sensor
  navSensorUpdate(ID := 55, status := "40$B0C", log_status := TRUE, desc := "Hot");
  ...
END;
END_PROGRAM;