Delta AS Series Programming Manual page 584

Hide thumbs Also See for AS Series:
Table of Contents

Advertisement

4.
CmpS (supposedly set as D100), Action (supposedly set as D200), Yno (supposedly set as D300), CmpLen
(supposedly set as 6), CurNo (as it is set below).
CurNo
(Current Group
Number)
1
2
3
4
5
6
CmpS: The source value of data in 32-bit integer. It takes several Dword space in CmLen. Thus it is suggested
to declare the array in the data type of Dword. The compared value is arranged in ascending order when the
source value is positive integers. The compared value is arranged in descending order when the source value is
negative integers. If the compared value is arranged not by the rules as mentioned, the instruction is not executed
and SM0 will be switched to ON. Error code SR0: 0x200B.
Action: Action to be taken when the comparison is made. The value is in 16-bit integer and it takes one word
space in CmLen. The value "1" here means setting the output point to ON. The value "0" here means setting the
output point to OFF. Use 16#8000 to clear the counter value to 0 and restart the cyclic counting. Only use the
value 1, 0 or 16#8000 in here. It is suggested to declare the array in the data type of Word.
 Yno: The number of the Y output point, this value should be a 16-bit integer. It takes several Word space in
CmLen. The format here is hexadecimal. For example, 16#0004 means the Y0.4 output point, 16#0016 Y1.6
output point, and 16#00AF Y10.15 output point. It is suggested to declare the array in the data type of Word.
 CurNo: The current group number that is making the comparison. From the table above, you can see if the
setting value in CmLen is 1000, the CurNo. Is 1.
5.
When the value you use in Yno is not the CPU built-in output points, the outputting is affected by the PLC scan
cycle. If you need the immediate output, use CPU built-in output points and hardware type high-speed counter in
HCno.
6.
Since this instruction is for cyclic comparing and outputting, you need to set a way to clear the counter value to 0 to
set a range for cyclic operation. It is suggested to use hardware input to set the counter to 0. Or you can also use a
setting to clear the counter. For example you need 6 groups to perform cyclic comparison. You can set the setting
value in CmpLen as 7 and you will have a 7 groups of CruNo (defined by CmpS). And then use 16#8000 as the
setting value in Action to clear HC. See the table below for reference.
CurNo
(Current Group
Number)
7 (CurNo=0)
7.
When the instruction is firstly executed, it compares the current counter value to the value set in CmpS and set the
value in CurNo accordingly. See the example table in number 4. If the current counter value is 2000, that
corresponds to the value (D102 = 2000) set in CmpS and the corresponding value of CurNo is 2. From there you
know the Y0.5 is ON.
8.
See the example in chronological illustration below.
  The instruction is firstly executed, comparing the current counter value (1500) and the value set in CmpS
(HC202). And set the value in CurNo to 1 and Y0.4 output to ON accordingly.
  When the current counter value reaches 2000, CurNo = 2 and Y0.5 is ON.
  When the current counter value reaches 3000, CurNo = 3 and Y0.6 is ON.
CmpS
(The source value of data in 32-
bit to be compared)
D100 = 1000
D102 = 2000
D104 = 3000
D106 = 4500
D108 = 5500
D110 = 6500
CmpS
(The source value of data in 32-
bit to be compared)
D112 = 8000
Ch ap te r 6 Ap pl ie d Instruc ti ons
Action
(Action to be taken when
the comparison is made.)
D200 = 1 (Set)
D201 = 1 (Set)
D202 = 1 (Set)
D203 = 0 (Reset)
D204 = 0 (Reset)
D205 = 0 (Reset)
Action
(Action to be taken when
the comparison is made.)
D206 = 16#8000
(Clear HC)
Yno
(The number of
Y output point)
D300 = 16#04 (Y0.4)
D301 = 16#05 (Y0.5)
D302 = 16#06 (Y0.6)
D303 = 16#04 (Y0.4)
D304 = 16#05 (Y0.5)
D305 = 16#06 (Y0.6)
Yno
(The number of
Y output point)
D306 = 0
(none)
6 - 3 0 5
6_

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents