Mitsubishi QD51 Programming Manual page 571

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
Program Example
10 ' This program repeats a calculation while the specified condition holds
20 I=1
30 WHILE I<10
40 PRINT "I=":I
50 I=I+1
60 WEND
70 PRINT "I exceeded 10"
80 END
RUN
I=1
I=2
I=3
I=4
I=5
I=6
I=7
I=8
I=9
I exceeded 10
OK
11 - 401
If the WHILE to WEND instructions are used in combination with the FOR to NEXT
instructions, take precautions so that the inner loop is completely contained
within the outer loop.
(Correct)
REMARK
See the FOR to NEXT instructions and Section 3.6.4.
FOR to TO
WHILE
:
WEND
NEXT
:
' Sets the initial value
:
' Repeats until I exceeds 10
:
' Displays the values of I
:
' Adds 1 to I
:
' Displays the result
MELSEC-Q
(Incorrect)
FOR to TO
WHILE
:
NEXT
WEND
11 - 401

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents