3 ) programming example – Yaskawa MP900 Series Ladder Programming Manual User Manual
Page 351

5.11 C-language Control Instructions
5.11.1 Call C-language Function (C-FUNC)
5-282
The parameters are described in the following table.
∗ This error is detected even when Execute is OFF.
( 3 ) Programming Example
In the following programming example, the CFUNC1 C-language function is executed.
First the CFUNC1 C-language function is loaded into the Controller.
Next, when the C-FUNC execution command (MB000000) turns ON, the CFUNC1 C-language function is executed
by the C-FUNC instruction.
The MA00100 and MA00200 addresses are passed to the C-language function as the arguments and the return value
from the function is set in DL00002. Options 1 and 2 are not used, so 0 is set for them.
Parameter Name
Description
I/O
Execution flag (Execute)
The C-FUNC function is executed when this command turns ON.
IN
Option 1 (Option1)
Option specification 1 (for future use)
IN
Option 2 (Option2)
Option specification 2 (for future use)
IN
Function name (C_Name)
Specify the first register address to pass to argument 1 of the user C-language
function.
IN
Argument 1 (C_Arg1)
Specify the first register address to pass to argument 1 of the user C-language
function.
IN
Argument 2 (C_Arg2)
Specify the first register address to pass to argument 2 of the user C-language
function.
IN
Completion flag (Complete)
Turns ON when execution of the C-FUNC function is completed.
OUT
Error flag (Error)
Turns ON when one of the following errors occurs.
• Register limit exceeded for C_Name, C_Arg.1, or C_Arg.2.
*
The sizes of C_Arg.1 and C_Arg.2 are not considered.
• The function specified by C_Name does not exist.
OUT
Return value (Return)
Stores the value that is returned by the user C-language function.
OUT