navGPIProgressReceive (Functionblock)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

MX2, AX9, CX1 pro/flex/warp, SX1, MX2 turbo/encore/warp, AX9 turbo, NX-200, NX-400, NX-900, LX2, LX4, LX5

Firmware version:

2.20 / 1.00.00

Nav. API level:

1


This function block returns information about the status and progress of a file transfer.

Note that the progress is only valid after a "File progress" event is raised; the event will be removed when this function block is called.

Note: this function block is not supported on the NMP.

 

 

Input:

None.

 

 

Output:

status : INT

The status of the transfer.

1

- Transfer in progress.

0

- Transfer completed.

-2

- Error communicating with navigation device.

-3

- Error reading file.

-4

- The navigation device rejected the transfer.

 

progress : SINT

The progress of the transfer in percent.

 

type : SINT

The type of file being transferred. Available starting with Firmware v4.70 / 1.30.00.

0

- GPI file.

1

- Custom form.

2

- Routes.

 

error : INT

The detailed error for the file transfer. Available starting with Firmware v4.70 / 1.30.00.

The error code depends on the file type.

Common error codes:

0

- Success.

1-4

- Transfer error.

5

- Invalid file.

6

- The file is not of the expected type.

7-15

- Transfer error.

 

In addition to the common error codes, most file types have detailed error codes that can be found in the documentation of the function that started the transfer:

Custom form

- navFormUploadFile.

Routes

- navStopSetRouteFile

 

 

ready : BOOL

TRUE:

If data is ready.

FALSE:

If data is not ready.

 

Declaration:

FUNCTION_BLOCK navGPIProgressReceive;
VAR_OUTPUT
  status   : INT;
  progress : SINT;
  ready     : BOOL;
  error     : INT;
  type      : SINT;
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR
  gpiRcv : navGPIProgressReceive;
END_VAR;
 
FUNCTION ReadGPIProgress;
  gpiRcv();
  IF gpiRcv.ready THEN
    DebugMsg(message := "*** progress received ***");
    DebugFmt(message := "-status=\1", v1 := gpiRcv.status);
    DebugFmt(message := "-progress=\1", v1 := gpiRcv.progress);
  END_IF;
END_FUNCTION;
 
THREAD_BLOCK navMonitor;
VAR
  event : INT := 0;
END_VAR;
 
WHILE event <> -1 DO
  event := navWaitEvent(timeout := -1);
  CASE event OF
     ...
    9: ReadGPIProgress();
     ...
  END_CASE;
END_WHILE;
END_THREAD_BLOCK;