Siemens TIA Portal PLC - Scaling/Converting Analog Input/Output (0-20mA to 4-20mA and vice versa)
Table of Contents
Introduction
In this tutorial, you'll learn how to scale and convert analog signals using the Siemens TIA Portal. Specifically, we will cover how to convert a 0-20mA input signal to a 4-20mA output and vice versa. This knowledge is crucial for ensuring proper signal processing in automation and control systems.
Step 1: Understanding Analog Signal Ranges
Before proceeding, familiarize yourself with the analog signal ranges:
- 0-20mA: Commonly used for various sensors.
- 4-20mA: Widely adopted in industrial applications, as it allows for a zero-signal reference.
Practical Tip
Using 4-20mA is preferred in many systems because it helps detect wire faults—if the current drops below 4mA, it indicates an issue.
Step 2: Setting Up TIA Portal
- Open TIA Portal on your computer.
- Create a new project or open an existing one where you want to implement the conversion.
- Add a new PLC to your project if it’s not already added.
Practical Advice
Ensure your PLC model supports the necessary analog input/output modules for the conversion.
Step 3: Configuring Analog Inputs and Outputs
- Navigate to the "Devices & Networks" view in TIA Portal.
- Select your PLC and add the appropriate analog input and output modules.
- Configure the modules for 0-20mA and 4-20mA as follows
- For the input module
- Set the range to 0-20mA.
- For the output module
- Set the range to 4-20mA.
Common Pitfall
Always double-check the module specifications to ensure compatibility with your chosen signal ranges.
Step 4: Programming the Conversion Logic
- Open the PLC programming environment (e.g., LAD, FBD, STL).
- Create a new function block for the conversion logic.
- Implement the following scaling logic to convert 0-20mA to 4-20mA:
IF InputValue < 0 THEN
OutputValue := 4;
ELSEIF InputValue > 20 THEN
OutputValue := 20;
ELSE
OutputValue := (InputValue * 16 / 20) + 4;
END_IF;
- For converting 4-20mA to 0-20mA, use this logic:
IF InputValue < 4 THEN
OutputValue := 0;
ELSEIF InputValue > 20 THEN
OutputValue := 20;
ELSE
OutputValue := (InputValue - 4) * 20 / 16;
END_IF;
Practical Tip
Always simulate your program before downloading it to the PLC to ensure the logic behaves as expected.
Step 5: Testing the Configuration
- Download the program to the PLC.
- Test the input by providing a known current signal (e.g., using a signal generator).
- Monitor the output to confirm the conversion logic is functioning correctly.
Common Pitfall
Ensure your wiring is correct; miswired inputs can lead to inaccurate readings and outputs.
Conclusion
You have successfully learned how to scale and convert analog signals in Siemens TIA Portal. By following these steps, you can effectively manage signal processing in your automation projects. For further learning, explore advanced topics such as PID control and more complex signal conversions.