ADVANCED: MODCALL

Top  Previous  Next

MODCALL is used for calling external C functions that have been developed by the RTCU Platform SDK.
The parameters to MODCALL are as follows:

 

The module name.

The symbolic name of the C-function.

Result code variable (INT)

o0 = Function was successfully invoked.

o1 = The symbolic function name was not found.

o2 = Invalid module and/or function name.

o3 = Not supported.

 

Before using an external module it must be loaded with the extModuleLoad function.

Also refer to the Platform Extension functions section.

 

The detailed semantics of MODCALL and the corresponding parameters are described in the RTCU Platform SDK.

 

 

Example:

FUNCTION isPrime : BOOL;
VAR
x : DINT;
rc : INT;
END_VAR;
 
isPrime := MODCALL("my_calc","is_prime_number",rc); // Call the 'is_prime_number' function in the 'my_calc' module.
                                                   // rc will contain 0 when the function was successfully invoked.
 
END_FUNCTION;