DL205 Analog Manual, 7th Edition Rev. D
14-14
Chapter 14: F2-4AD2DA, 4-Ch. In / 2-Ch. Out Analog Combination
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
The example program below shows how to write the program to perform engineering unit
conversions. This example will work with all CPUs and assumes that the engineering unit
values have been calculated or loaded and stored in V2300 and V2301 for channels 1 and
2 respectively. Also, the final values are moved to V2004 and V2005, which are memory
locations that are used in the following examples. Any user V-memory locations can be used,
but they must match the locations that are specified as the source for the output data (see the
next section for an example).
NOTE:
Since the DL250 can do math operations in BCD format, it is better to perform the math calculations in BCD.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
b
C
D
The LD instruction loads the engineering units used with channel 1 into
the accumulator. This example assumes the numbers are BCD. Since
SP1 is used, this rung automatically executes on every scan. You could
also use an X, C, etc. permissive contact.
LD
V2300
SP1
MUL
K4095
DIV
K1000
Multiply the accumulator by 4095 (to start the conversion).
Divide the accumulator by 1000 (because we used a multiplier of 10,
we have to use 1000 instead of 100).
OUT
V2004
Store the BCD result in V2004 (the actual steps required to send the
data are shown later).
The LD instruction loads the engineering units used with channel 2 into
the accumulator. This example assumes the numbers are BCD. Since
SP1 is used, this rung automatically executes on every scan. You could
also use an X, C, etc. permissive contact.
LD
V2301
SP1
MUL
K4095
DIV
K1000
Multiply the accumulator by 4095 (to start the conversion).
Divide the accumulator by 1000 (because we used a multiplier of 10,
we have to use 1000 instead of 100).
OUT
V2005
Store the BCD result in V2005 (the actual steps required to send the
data are shown later).
Содержание DL205
Страница 1: ...DL205 Analog I O Manual Manual Number D2 ANLG M ...
Страница 2: ...Notes ...
Страница 6: ...Notes ...