Temperature Sensor Units
Programming Example 2
20-point CPU Unit
Inputs
IR 000
Outputs
IR 010
Programming with BCD(24) Instruction
25313
(Always ON Flag)
02000
Execution condition
206
The following programming example shows how to convert the data for temper-
ature input 0 to BCD and store the result in DM 0000 and DM 0001. "0001" is
stored in DM 0001 when the input data is a negative value. The following system
configuration is used.
Temperature Sensor Unit
Inputs
IR 001
IR 002
Temperature unit setting:
Two-decimal-place Mode:
Input range setting:
Temperature input 0 storage word: IR 001
Outputs
None
CMP (20)
CMP (20)
25506(=)
25506(=)
00115
BDC (24)
MOV (21)
00115
CLC (41)
SBB (51)
BCD (24)
MOV (21)
OFF ( C)
OFF (normal)
1 (Pt100, –200.0 to 650.0 C)
Detects completion of input 0 initialization.
001
#7FFE
ON when input 0 has been initialized
02000
Detects an open-circuit alarm or Unit error by check-
ing converted temperature data for the error code
002
7FFF.
#7FFF
ON when an open-circuit alarm or Unit error has been
01000
detected for input 0.
When the input temperature data is non-negative,
converts the contents of IR 001 (temperature data
001
for input 0) to BCD and stores the result in
DM0000
DM 0000.
Stores #0000 in DM 0001.
#0000
DM0001
When the input temperature data is negative, con-
#0000
verts the contents of IR 001 to the absolute value of
the actual temperature and stores the result in
001
DM 0000.
DM0000
Converts the contents of DM 0000 (absolute value
of negative temperature data for input 0) to BCD
DM0000
and stores the result in DM 0000.
DM0000
Stores #0001 in DM 0001 to indicate a negative
number.
#0001
DM0001
Section
3-2
Need help?
Do you have a question about the CPM1 - PROGRAMING MANUAL 02-2001 and is the answer not in the manual?