nmpButtonFlash (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

MX2i pro, CX1 pro/flex/warp, SX1, MX2 turbo, NX-200, NX-400, NX-900, LX2

Firmware version:

2.64 / 1.00.00

Nav. API level:

2


This function will make the background of a configurable button on the NMP begin or stop alternating between its normal background color and its specified color. This feature can be used to bring attention to the device.

 

 

Input:

id : INT

The ID of the button - between 1 and the button count defined in nmpButtonsDefine.

 

flash : BOOL

This determines if the button should flash or not. If false, the remaining parameters are ignored.

 

duration : INT (0..32767, default : 0)

The number of seconds to flash for. Use 0 to keep flashing until stopped with a call to nmpButtonFlash.

 

period : INT (100..32767, default : 1000)

The number of milliseconds between each color change. This can be used to change the flashing frequency and is rounded up to the next 100 milliseconds.

 

color: DINT (16#00_00_00..16#FF_FF_FF, default: 16#00_FF_00)

Determines the color that the button should flash to.

Instead of specifying the color directly, the nmpRGBToDint function can be used.

 

night_color: DINT (-1, 16#00_00_00..16#FF_FF_FF, default: -1)

Determines the color of the button to use when flashing in the night theme. If -1, the normal color will be used.

Instead of specifying the color directly, the nmpRGBToDint function can be used.

 

Returns: INT

0

- Success.

-1

- Navigation interface is not open.

-2

- Error communicating with navigation device.

-4

- The navigation device rejected the command.

-8

- Invalid parameter.

-11

- This is not supported by the device (the device is not an NMP device).

-12

- Navigation interface is busy.

 

Declaration:

FUNCTION nmpButtonFlash : INT;
VAR_INPUT
  id       : INT;
  flash   : BOOL;
  duration : INT := 0;
  period   : INT := 1000;
  color   : DINT := 16#00FF00;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc : INT;
END_VAR;
BEGIN
  ...
  // Make button 1 flash blue for 5 seconds
  rc := nmpButtonFlash(id := 1, flash := TRUE, duration := 5, period := 500,
color := 16#00_00_FF);
  IF rc <> 0 THEN
    DebugFmt(message := "Error: nmpButtonFlash=\1", v1 := rc);
  END_IF;
  ...
END;
END_PROGRAM;