2) format, 3) programming examples, 2) format (3) programming examples – Yaskawa MP2000 Series: User's Manual for Motion Programming User Manual
Page 268
8.10 C-Language Control Commands
8-161
8
Command Reference
(2) Format
(3) Programming Examples
The CFUNC command programming example is shown below.
CFUNC EXECUTE OPTION1 OPTION2, C_NAME C_ARG1 C_ARG2,
COMPLETE ERROR C_RETURN;
I/O
Defini-
tion
No.
Name
I/O
Designation
Description
Input
1
EXECUTE
B-VAL
Designates execution of CFUNC function
2
OPTION1
I-REG
Option designation 1 (For future use)
3
OPTION2
I-REG
Option designation 2 (For future use)
4
C_NAME
Address input
Designates the leading register No. (MW/DW address) of the registers
where the user c-language function name is stored.
5
C_ARG.1
Address input
Designates the leading register No. (MW/DW address) to be set for the
user C-language function 1st argument.
6
C_ARG.2
Address input
Designates the leading register No. (MW/DW address) to be set for the
user C-language function 2nd argument.
Output
1
COMPLETE
B-VAL
Completes execution of the CFUNC function
2
ERROR
B-VAL
Error occurrence
• C_NAME, C_ARG.1, C_ARG.2 register over the upper/lower limit
(The sizes of C_ARG.1 and C_ARG.2 are not taken into consider-
ation.)
Note: Detected also when the EXECUTE input is OFF.
• The function designated in C_NAME does not exist.
3
C_RETURN
L-REG
Stores the return value of user C-language function as it is.
ASCII 'cfunc1' DW00010; "User C-language function name
DW00013 = 0000H; "NULL code
DB000000 = 1; "Execute the user C-language function
CFUNC DB000000 0 0,DA00010 DA00002 DA00004, DB000003 DB000004
DL00016;
EXAMPLE