Sample program (Analog input: For ranges of -10 V to +10 V and -5 V to +5 V)
The following program shows the case that conversion data of the first expansion analog input
unit (CH0 to CH7) is read and stored in DT0 to DT7.
X3E
X3F
①
②
X3D
③
X3D
③
X3E
X3F
①
②
X3D
③
X3D
③
X3E
X3F
①
②
X3D
③
X3D
③
X3E
X3F
①
②
X3D
③
X3D
③
①
X3F
The channels of conversion data read by turning on/off the conversion data switching flags X3F
and X3E are distinguished.
②
X3E
③
The signs of conversion data of read odd numbered channels are distinguished. When plus,
X3D
OFF. When minus, ON.
ⓐ
Conversion data of even numbered channels CH0/CH2/CH4/CH6 is transferred as is.
When the data of odd numbered channels CH1/CH3/CH5/HC7 is positive, the most significant two bits
ⓑ
are masked by "00" with F65 WAN (AND) instruction, and the data is stored in DT1/DT3/DT5/DT7.
ⓒ
When the data of odd numbered channels CH1/CH3/CH5/HC7 is negative, the most significant two bits
are masked by "11" with F66 WOR (OR) instruction, and the data is stored in DT1/DT3/DT5/DT7.
[ F0 MV
, WX2 , DT0
[ F65 WAN , WX3 , H3FFF , DT1
[ F66 WOR , WX3 , HC000 , DT1
[ F0 MV
, WX2 , DT2
[ F65 WAN , WX3 , H3FFF , DT3
[ F66 WOR , WX3 , HC000 , DT3
[ F0 MV
, WX2 , DT4
[ F65 WAN , WX3 , H3FFF , DT5
[ F66 WOR , WX3 , HC000 , DT5
[ F0 MV
, WX2 , DT6
[ F65 WAN , WX3 , H3FFF , DT7
[ F66 WOR , WX3 , HC000 , DT7
4.2 Analog input unit (FP0R-AD4/AD8)
]
]
]
]
]
]
]
]
]
]
]
]
ⓐ
ⓑ
ⓒ
ⓐ
ⓑ
ⓒ
ⓐ
ⓑ
ⓒ
ⓐ
ⓑ
ⓒ
4-5