3) programming examples – Yaskawa MP2000 Series: User's Manual for Motion Programming User Manual
Page 266
![background image](https://www.manualsdir.com/files/819957/content/doc266.png)
8.10 C-Language Control Commands
8-159
8
Command Reference
* The
μITRON detection errors will not occur normally because the system manages them.
Note: 1. The EXECUTE input is not used for the signal rising edge, but treated as level. This is to implement task
control in every scan cycle.
2. The task controls except for RESET can be executed by motion programs, sequence programs for high-
speed scan drawing, and sequence programs for low-speed scan drawing. They cannot be executed by
sequence programs for start drawing.
3. The task control type RESET can be executed only by sequence programs for low-speed scan drawing.
(3) Programming Examples
A CTSK command programming example is shown below.
I/O
Defini-
tion
No.
Name
I/O
Desig-
nation
Description
Input
1
EXECUTE
B-VAL
Designates of execution of CTSK function.
2
TYPE
I-REG
Designates the task control type.
1: WAKEUP
Wakes up the task from the WAIT status.
2: RESET
Valid only for sequence programs (low scan)
Exits and deletes the task once, and then creates and starts a task.
The started task then enters the WAIT status.
3: SUSPEND Interrupts the task and moves the task to the SUSPEND status.
4: RESUME
Moves the task from the SUSPEND status to the READY status.
3
C_NAME
Address
input
Designates the leading register number (MW/DW address) of the registers where the
user C-language task name (project name) is stored.
Output
1
COMPLETE
B-VAL
Completes execution of CTSK function
2
ERROR
B-VAL
Error occurrence (The contents of error is reported to ERR_CODE.)
3
ERR_CODE
L-REG
Error code
0x00000000
No error
0x0000006F
DWG (drawing) type error
• CTSK function was executed by a sequence program (start drawing)
0x00000091
• TYPE setting error
• TYPE set value is out of the range.
• The task was neither in the WAIT nor WAIT-SUSPEND status when
the task control type WAKEUP was executed.
• The task was neither in the WAIT nor READY status when the task
control type SUSPEND was executed.
0x00000094
The task designated in C_NAME does not exist.
0x00000096
C_NAME register over the upper/lower limit
Note: This can be detected also when EXECUTE input is OFF.
0xFFFFFFDD μITRON detection error (Invalid ID number)
*
0xFFFFFFCC μITRON detection error (Task not registered)
*
0xFFFFFFC1
μITRON detection error (Illegal object status)
*
• The task is in DORMANT status.
• RESUME was commanded to a task that was not in SUSPEND status.
0xFFFFFFBB μITRON detection error (Context eror)
*
• Cannot issue from the task independent context.
0xFFFFFFB7 μITRON detection error (Queue overflow)
*
ASCII 'ctask1' DW00010; "User C-language task name
DW00013 = 0000H; "NULL code
DW00002 = 1; "WAKEUP
DB000001 = 1; "Execute the task control
CTSK DB000001 DW00002, DA00010, DB000002 DB000003 DL00004;
EXAMPLE