Download Alspa C80-35 Programming Manual

Transcript
Alspa P8–25/35/05 Instruction Set
Example 3:
Using word memory, for SR and DS, the third least significant bit of %R0001 through the second least significant
bit of %R0002 of the array containing all 16 bits of %R0001 and four bits of %R0002 is read and then written into
the fifth least significant bit of %R0100 through the fourth least significant bit of %R0101 of the array containing
all 16 bits of %R0100 and four bits of %R0101.
|
_____
|%I0001 |
|
|——| |———|ARRAY|—
|
|MOVE_|
|
| BIT |
|%R0001 —|SR DS|— %R0100
|
| LEN |
|
|00020|
| CONST —|SNX |
| 00003 |
|
|
|
|
| CONST —|DNX |
| 00005 |
|
|
|
|
| CONST —|N
|
| 00016 |_____|
|
7.2.
SRCH_EQ and SRCH_NE
SRCH_GT and SRCH_LT
SRCH_GE and SRCH_LE
(INT, DINT, BYTE, WORD)
Use the appropriate Search function listed below to search for all array values for that particular operation.
Abbreviation
Function
Description
SRCH_EQ
Search Equal
Search for all array values equal to a specified value.
SRCH_NE
Search Not Equal
Search for all array values not equal to a specified value.
SRCH_GT
Search Greater Than
Search for all array values greater than a specified value.
SRCH_GE
Search Greater Than or
Equal
Search for all array values greater than or equal to a specified value.
SRCH_LT
Search Less Than
Search for all array values less than a specified value.
SRCH_LE
Search Less Than
or Equal
Search for all array values less than or equal to a specified value.
Each function has four input parameters and two output parameters. When the function receives power, the array
is searched starting at (AR + input NX). This is the starting address of the array (AR) plus the index into this array
(input NX).
The search continues until the array element of the search object (IN) is found or until the end of the array is
reached. If an array element is found, output parameter (FD) is set ON and output parameter (output NX) is set
to the relative position of this element within the array. If no array element is found before the end of the array
is reached, then output parameter (FD) is set OFF and output parameter (output NX) is set to zero.
ALS 52102 c–en
Alspa C80–35, C80–25 and C80–05 PLCs Reference Manual
Page 4–79