Special Hardware Requirements:
This programming example shows how to measure temperature using 2 digital inputs. A temperature time module outputs a temperature value in binary-coded decimal (BCD) format once every second. By using an additional amplifying circuit, the pulses (13 in 18 ms) are transferred to the S7-200 inputs

Structure of the Amplifying Circuit:

Time diagram of the pulses as they leave the temperature time module:

Note:
The inputs on the S7-200 are only guaranteed to detect pulses that are at least 0.2 ms in length. As seen in the figure above, the pulses are only 0.125 ms long as they leave the temperature time module. Therefore it is necessary to use an optocoupler in the amplifying circuit that outputs a slower pulse than it reads in. The optocoupler needs to be able to read in the pulses which are 0.125 ms in length and output pulses which are at least 0.2 ms long. Also, the pulses need to be less than 0.7 ms so that there is enough time between pulses for the CPU to be able to distinguish between them. This means that the delta between the optocoupler’s turn-on time and turn-off time needs to be between 0.075 ms and 0.675 ms. Since the optocoupler’s turn-on time is faster than the turn-off time, the width of the pulses is increased from 0.125 ms to at least 0.2 ms.

Download Program Example


















