extModuleLoad (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

1.04.00


This function will load and initialize an extension module.

The extension module must be installed by adding it to the Platform Extension in the project view, and transferring the project.

 

 

Input:

path : STRING

The full path to the module, as shown in the Platform Extension dialog.

 

Returns: INT

1

- The module is loaded.

0

- The function is not available.

-1

- Invalid path. Make sure that the path is correct and that the drive is open.

-2

- The file in path is not a valid module.

-3

- No more modules can be loaded.

-4

- The module could not be loaded.

-5

- Failed to initialize module.

-6

- Module was build for a different architecture.

 

Declaration:

FUNCTION extModuleLoad : INT;
VAR_INPUT
   path   : STRING;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
   rc     : INT;
   status : DINT;
   handle : SYSHANDLE;
END_VAR;
 
   // Initialize
   fsMediaOpen(media := 1);
 
   // Load modules
   rc := extModuleLoad(path := "b:\system\ext\example.rmx");
   IF rc < 1 THEN
      DebugFmt(message := "extModuleLoad=\1", v1 := rc);
   END_IF;
 
BEGIN
END;
END_PROGRAM;