![Mitsubishi Electric CR750 Series Instruction Manual Download Page 320](http://html.mh-extra.com/html/mitsubishi-electric/cr750-series/cr750-series_instruction-manual_238840320.webp)
4-300
Detailed explanation of command words
Wait (Wait)
[Function]
Waits for the variable to reach the designated value.
[Format]
[Terminology]
<Numeric variable>
Designate a numeric variable. Use the input/output signal variable (in such cases
as M_In, M_Out) well.
<Numeric constant>
Designate a numeric constant.
[Reference Program]
(1) Signal state
1 Wait M_In(1)=1
' The same meaning as 1 *L10:If M_In(1)=0 Then GoTo *L10.
2 Wait M_In(3)=0
(2) Task slot state
3 Wait M_Run(2)=1
(3) Variable state
4 Wait M_01=100
[Explanation]
(1) This command is used as the interlock during signal input wait and during multitask execution.
(2) The Wait instruction allows the program control to continue to the next step once the specified condition
is met.
(3) In case the Wait instruction is executed in several tasks at one time in the multitask execution status, the
processing time (tact time) may become longer and affect the system. In such cases, use the If-Then
instruction instead of the Wait instruction.
(4) Number of conditions which may be included in a Wait command is one. If more than one is included, an
erroneous judgment or an error in execution process can result.
An example of wrong indication) Wait M_In(38)=1 Or M_In(39)=1
→
There are two ways to avoid it.
1) Avoid using the Wait command and use the "If-Then" statement instead
.
Example) *Loop
If M_In(38)=1 Or M_In(39)=1 Then *Next Else *Loop
*Next
2) Set 0 (conditional command) to the parameter PRSPEC.
(5) If Wait and CallP commands are executed at the same time in a multitask program, it may affect the sys-
tem. For a possibility that these commands are executed at the same time in a multitask program, set 0
(conditional command) in the parameter PRSPEC.
Wait[]<Numeric variable>=<Numeric constant>