Programming With Bcd(24) Instruction - Omron CP1L-EL20DR-D Operation Manual

Sysmac cp series cp1l-el/em cpu unit
Table of Contents

Advertisement

Temperature Sensor Units
2. The following programming example shows how to convert the data for
temperature input 0 to BCD and store the result in D0 and D1. "0001" is
stored in D1 when the input data is a negative value. The following system
configuration is used.
CP1L-EM CPU Unit
with 40 I/O points
CIO 0
Inputs
CIO 1
Outputs
CIO 100
CIO 101
Temperature unit setting
Two-decimal-place Mode
Input range setting
Input 0

Programming with BCD(24) Instruction

Always ON
P_On
Execution
condition
1000.00
P_EQ
P_EQ
2.15
2.15
CP1W-TS001/101
Temperature Sensor Unit
CIO 2
CIO 3
None
0 (°C)
0 (normal)
1 (Pt100: −200.0 to 650.0°C)
CIO 2
Detects completion of input 0 initialization.
CMP(020)
2
#7FFE
1000.00
ON when input 0 has been initialized
Detects an open-circuit alarm or Unit
CMP(020)
error by checking whether the error code
2
7FFF has been output.
#7FFF
ON when an open-circuit alarm or Unit
100.00
error has been detected for input 0.
BCD(024)
Stores positive BCD data in D0.
2
D0
MOV(021)
Stores #0000 in D1.
#0000
D1
−(410)
#0000
When input 0 converted value is negative
2
(#0000 minus two's complement = actual
value)
D0
BCD(024)
D0
Stores negative BCD data in D0.
D0
MOV(021)
#0001
Stores #0001 in D1 to indicate a
D1
negative number.
Section 9-5
521

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents