Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual page 211

Hide thumbs Also See for CPM1 - PROGRAMING MANUAL 02-2001:
Table of Contents

Advertisement

Analog I/O Units
Ladder Program
SR 25315
(Always ON Flag)
T005
Turn OFF the power supply for the load before turning OFF the power supply
for the CPU Unit.
Specifying the Range Code
Specify the I/O signal range by writing the range code to the Analog I/O Unit's
output word from the ladder program in the first cycle of program execution. The
Analog I/O Unit will start to convert analog I/O values once the range code has
been specified and convertible values are provided. (Refer to page 170.)
Write the range code to the Analog I/O Unit's output word in the first cycle of op-
eration; the Analog I/O Unit's output word is "n+1" when "n" is the last word allo-
cated to the CPU Unit, or previous Expansion Unit or Expansion I/O Unit in the
configuration.
Reading Converted Analog Input Values
The ladder program can be used to read the memory area where the converted
values are stored. Values are output to the next two words (m + 1, m + 2) follow-
ing the last input word (m) allocated to the CPU Unit or previous Expansion Unit
or Expansion I/O Unit.
Writing Analog Output Set Values
The ladder program can be used to write data to the output word where the set
value is stored. The output word will be "n+1" when "n" is the last output word
allocated to the CPU Unit, or previous Expansion Unit or Expansion I/O Unit.
Startup Operation
After power is turned ON, it will require two cycle times plus approx. 50 ms before
the first data is converted. The following instructions can be placed at the begin-
ning of the program to delay reading converted data from analog inputs until con-
version is actually possible.
Note Analog input data will be 0000 until initial processing has been completed. Ana-
log output data will be 0 V or 0 mA until the range code has been written. After the
range code has been written, the analog output data will be 0 V or 0 mA if the
range is 0 to 10 V, –10 to 10 V, or 0 to 20 mA, or it will be 1 V or 4 mA if the range is
1 to 5 V or 4 to 20 mA.
TIM 005
#0002
MOV (21)
001
DM0000
Handling Unit Errors
If an error occurs in an Analog I/O Unit, the Error Flags in AR 0200 to AR 0204 for
the CPM2C and AR 0200 to AR 0202 for the CPM1A/CPM2A will be turned ON.
The addresses of the Error Flags are in the order that the Expansion Units and
Expansion I/O Units are connected in the PC, with AR 0200 used for the Expan-
sion Unit or Expansion I/O Unit closest to the CPU Unit. Use these flags in the
program when it is necessary to detect errors.
When an error occurs in the Analog I/O Unit, analog input data will be 0000 and
0 V or 0 mA will be output as the analog output.
If a CPU error or an I/O bus error (fatal errors) occurs at the CPU Unit and the
analog output is set to 1 to 5 V or 4 to 20 mA, 0 V or 0 mA will be output. For any
other fatal errors at the CPU Unit, 1 V or 4 mA will be output.
TIM 005 will start as soon as power turns ON.
After 0.1 to 0.2 s (100 to 200 ms), the Comple-
tion Flag for TIM 005 will turn ON, and the con-
verted data from analog input will be read from
IR 001 and stored in DM 0000.
Section
3-1
191

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents