![background image](http://html1.mh-extra.com/html/omron/srm1-programing-02-2001/srm1-programing-02-2001_programming-manual_742414226.webp)
3-2
Section
Temperature Sensor Units
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.
20-point CPU Unit
Temperature Sensor Unit
Temperature unit setting:
OFF (
°
C)
Two-decimal-place Mode:
OFF (normal)
Input range setting:
1 (Pt100, –200.0 to 650.0
°
C)
Temperature input 0 storage word:
IR 001
Inputs
IR 000
Outputs
IR 010
Inputs
IR 001
IR 002
Outputs
None
Detects completion of input 0 initialization.
ON when input 0 has been initialized
When the input temperature data is non-negative,
converts the contents of IR 001 (temperature data
for input 0) to BCD and stores the result in
DM 0000.
Execution condition
Detects an open-circuit alarm or Unit error by check-
ing converted temperature data for the error code
7FFF.
25313
(Always ON Flag)
ON when an open-circuit alarm or Unit error has been
detected for input 0.
Stores #0000 in DM 0001.
When the input temperature data is negative, con-
verts the contents of IR 001 to the absolute value of
the actual temperature and stores the result in
DM 0000.
Converts the contents of DM 0000 (absolute value
of negative temperature data for input 0) to BCD
and stores the result in DM 0000.
Stores #0001 in DM 0001 to indicate a negative
number.
02000
CMP (20)
001
#7FFE
01000
CMP (20)
002
#7FFF
02000
25506(=)
MOV (21)
#0000
DM0001
BDC (24)
001
DM0000
00115
25506(=)
BCD (24)
DM0000
DM0000
SBB (51)
#0000
001
DM0000
CLC (41)
MOV (21)
#0001
DM0001
00115
Programming with BCD(24) Instruction
Programming Example 2