Mitsubishi Electric Melsec Q Series Programming Manual page 381

Motion controller (sv13/sv22)
Hide thumbs Also See for Melsec Q Series:
Table of Contents

Advertisement

5 OPERATION CONTROL PROGRAMS
POINT
Since the incremental value continues to be added to the loop control counter
specified with (D) until it reaches the final value, set the data type which the value
can handle.
When the data range exceeds the loop control counter range, an unintended repeat
operation may occur as the value is considered to be wrong.
In the following program, the data type of loop control counter #0 is 16-bit integer
type, and the data range is from -32768 to 32767.
FOR #0 = K0 TO K30000 STEP K10000
#1 = #1 + K1
NEXT
When this program is executed, #0 changes as follows and exceeds the 16-bit
integer type data range in the middle. Therefore, the program is not ended with four
executions of the loop.
• First execution of the loop
• Second execution of the loop : #0 is 10000.
• Third execution of the loop
• Forth execution of the loop
• Fifth execution of the loop
• Sixth execution of the loop
:
: #0 is 0.
: #0 is 20000.
: #0 is 30000.
: #0 is -25536.
(Note): #0 is 40000, but overflow will occur as it is
outside the data range.
: #0 is -15536.
5 - 158

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents