Special Hardware Requirements:
This program example shows how you can check an EM 231 Resistance Temperature Detector (RTD) module for errors and then read two analog values from an error-free module into your program.
The EM 231 RTD module provides a convenient interface for the S7-200 family to several different RTDs. It also allows the S7-200 to measure three different resistance ranges.
You must use DIP switches to select RTD type, wiring configuration, temperature scale, and burnout direction. For the DIP switch settings to take effect, you need to power cycle the programmable logic controller and/or the user 24 V power supply.
You must connect user power to pins 1 and 2 of the power connector. You must connect pin 3 of the power connector to a nearby chassis ground.
All RTDs attached to the module must be of the same type.
If you do not use an RTD input channel, you should wire a resistor to the unused channel inputs to prevent errors from floating inputs from blocking error indications from valid channels.
The channel data format is two’s complement, 16-bit words. Temperature is presented in units of 0.1 º. For example, if the measured temperature is 100.2 º, the reported data is 1002.) Voltage data are scaled to 27648. For example, -60.0mV is reported as -20736 (= -60mV/80mV * 27648).
When you are using the RTD module, be sure to disable analog filtering in the programmable logic controller. Analog filtering can prevent error conditions from being detected in a timely manner. Disable the analog input filtering by selecting the following commands in STEP 7-Micro/WIN:
From the View menu, choose System Block. In the System Block dialog box, select the Analog Input Filters tab. Clear the check boxes for the appropriate input points. Any changes made to the System Block will not be seen by the controller until the block is downloaded to the controller.
It is recommended that open wire/out of range indications be latched in the application program after valid data has been reported.
The S7-200 Programmable Controller System Manual provides additional information about the EM 231 Resistance Temperature Detector module and the special memory bytes for the ID and error registers of I/O modules.
Program Description
Initialization
In the first program scan cycle, the program clears the variable memory area from variable memory word VW0 through variable memory word VW10. VW0 and VW2 are used for the images of the analog input values from the two input channels (RTD0 and RTD1) of an RTD module. VW10 is used to store any error information from an RTD module.
Check RTD Module 0 for Errors
When the input for this subroutine is 0, the subroutine copies the values from the ID register and error register of the module in slot 0 into local memory word LW2. It then checks the signal state of the bits for the following types of errors: No User Power/Module, Out of Range, ID, and Configuration. After the subroutine checks for errors, it returns control to the main program.
To check an additional RTD module for errors, copy the instructions from Network 9 and place them in another network, such as Network 12. In the new network, change the input to the Call instruction from 0 to the number of the slot that contains the RTD module which you want to check, such as 3. There are seven slots available for expansion modules (slots 0 through 6). The subroutine in this program provides a network to check a module in each of the seven slots.
If There Are No Errors, Store the Analog Values
If there are no errors, the program copies the analog values from the two input channels of the RTD module into variable memory words VW0 and VW2.
If There Is an Error, Store the Error Information and Clear RTD1
If any of the error bits are set, the program copies the contents of memory byte MB0 and stores it in variable memory byte VB10. MB0 is the area of memory that contains the record of any errors found in the module. The program also clears the image of the inputs from RTD channel 1.
The S7-200 Programmable Controller System Manual provides additional information about the EM 231 Thermocouple module and the special memory bytes for the ID and error registers of I/O modules.
Download Program Example


















