IDEC FC4A-C10R2 User Manual page 328

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

19: C
C
OORDINATE
ONVERSION
Example: Overlapping Coordinates
In this example, the XYFS instruction sets up three coordinate points, which define two different linear relationships
between X and Y. The three points are: (X0, Y0) = (0, 100), (X1, Y1) = (100, 0), and (X2, Y2) = (300, 100). The two line
segments define overlapping coordinates for X. That is, for each value of Y within the designated range, there would be
two X values assigned.
XYFS(I)
M8120
CVXTY(I)
I0
CVYTX(I)
I1
(X0, Y0)
Y
(0, 100)
100
D90 (75)
D95 (40)
0
The first line segment defines the following relationship for X to Y conversion:
Y
=
X
+
100
The second line segment defines another relationship for X to Y conversion:
1
Y
=
-- -X 50
2
For X to Y conversion, each value of X has only one corresponding value for Y. If the current value of counter C10 is 250, the
value assigned to D90 is 75.
For Y to X conversion, the XYFS instruction assigns two possible values of X for each value of Y. The relationship defined by the
first two points has priority in these cases. The line between points (X0, Y0) and (X1, Y1), that is, the line between (0, 100)
and (100, 0), has priority in defining the relationship for Y to X conversion (X = –Y + 100).
Therefore, if the value in data register D95 is 40, the value assigned to D30 is 60, not 180.
Exactly the same two line segments might also be defined by the XYFS instruction, except that the point (300, 100) could be
assigned first, as (X0, Y0), and the point (100, 0) could be defined next, as (X1, Y1). In this case, this linear relationship would
have priority.
In this case, if the value in data register D95 is 40, the value assigned to D30 is 180, not 60.
19-6
I
NSTRUCTIONS
S1
X0
Y0
0
0
100
S1
S2
D1
0
C10
D90
S1
S2
S1
0
D95
D30
(X1, Y1)
(100, 0)
D30
100
(60)
« FC4A M
X1
Y1
X2
100
0
300
C10
(250)
S
U
'
M
ICRO
MART
SER
S
ANUAL
M8120 is the initialize pulse special
Y2
internal relay.
100
At startup, XYFS specifies three points.
CVXTY converts the value in C10 and
stores the result in D90.
CVYTX converts the value in D95 and
stores the result in D30.
END
(X2, Y2)
(300, 100)
300
X
»

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents