Skip to main content

2.1.1. TaskStart

2.1.1. TaskStart

 

The TaskStart statement creates a subtask, assigns a specific JOB program to the subtask, and starts the subtask program. TaskStart can also create a subtask in the main task or create another subtask in a subtask.

 

The format of the TaskStart statement is as follows. You can input the TaskStart command by selecting [F6]: Command inputF3: OthersTaskStart in sequence.

 

 

Item

Content

Subtask Number

Designate the task number to be created (1–7)

Program Number

Designate the program to be executed in a created subtask (1–9999)

Example of Use

TaskStart SUB=1,JOB=0010

(Execute by assigning 0010.JOB to subtask 1)

 

Figure 2.1 Example of the TaskStart Command Use

 

 

Figure 2.2 Example of creating a subtask and waiting for its termination

 

What requires attention is that the number of the subtask to be created is a different subtask number and not its own number of the current subtask. In addition, the TaskStart statement is inapplicable in the error situations described below, so it is necessary to take precaution.

 

Firstly, in a situation where the subtask created using TaskStart has been already created and in the middle of being executed and has not been completed, if the same program or another program is assigned to the same subtask as a subtask program, an error will occur. Please refer to the examples below.

 

 

<Error because of a re-execution in the middle of a subtask execution>

 

 

<Error because of the assignment and execution of another program in the middle of a subtask execution>

 

 

 

Secondly, an error will also occur if the same program is assigned to multiple subtask programs simultaneously. Please refer to the examples below.

 

<Error because of setting the same program to a different subtask>

 

 

Thirdly, an error will occur when creating the main task program (JOB file currently being executed in the main task) as a subtask program. In other words, it is impossible to assign the same JOB file in the main task and subtask.

 

 

<Error because of setting the same program in the main task and subtask>