0% found this document useful (0 votes)
262 views7 pages

Experiment (9) Analog Input and Analog Output Using PLC

This document describes an experiment using a PLC to control analog input and output signals. It discusses: 1) Reading analog sensor values like a potentiometer using an analog input module and scaling the values using math or library functions. 2) Sending analog output signals to devices like LEDs to control brightness using an analog output module. 3) Writing ladder logic programs to read analog sensor values and control analog devices at different thresholds of the sensor values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
262 views7 pages

Experiment (9) Analog Input and Analog Output Using PLC

This document describes an experiment using a PLC to control analog input and output signals. It discusses: 1) Reading analog sensor values like a potentiometer using an analog input module and scaling the values using math or library functions. 2) Sending analog output signals to devices like LEDs to control brightness using an analog output module. 3) Writing ladder logic programs to read analog sensor values and control analog devices at different thresholds of the sensor values.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Experiment (9)

Analog Input and Analog Output using PLC


Introduction
In this experiment, we are going to study the analog input and analog output modules in Siemens
S7-400 PLC. Also, this sample experiment provides an example for using mathematical
operations and the standard S7 library functions for scaling and analog input values.

Objectives
This experiment aims to:
1- Illustrate the principle of operation of analog input and analog output modules.
2- Write a ladder logic programs to read from analog devices, e.g. potentiometers.
3- Write a ladder logic programs to send analog signals to analog devices, e.g. LEDs.
4- Using the library SCALE Function (FC105) to scale the value for an analog input.

Theory

Analog input
An analog input converts a voltage level into a digital value that can be stored and processed in a
computer. There are a multitude of sensors available which convert temperature, pressure, etc.
into voltages.
The computer can then convert the voltage value into its original type (temperature, pressure,
etc) and the value can then be stored in a file, emailed to someone, or used to control something
else outside of the computer.
Analog output
The analog outputs convert digital values from a computer into a variable voltage level presented
on an output terminal. This provides an adjustable output. This can be used to control the speed
of a motor, light brightness … etc.
The operation of analog input and analog output modules
The analog sensor produces a difference in resistance, current or voltage which is received in
analog input module and converted into a digital value that is stored in a memory word.
The CPU processes data and generates a digital signal that is converted into an analog output
using the analog output module. This value is used to control a specific analog actuator.
Figures 1 and 2 illustrate the operation of analog input and analog output modules.
Mechatronics Systems Design Lab

CPU

Analog Analog Input PIW


Sensor Module

Analog Analog Output


PQW
Actuator Module

Figure 1: Analog input and analog output modules

Memory
MR PIW512 CPU
module ADC
PIW514
…….etc

Figure 2: ADC

Where:
MR: Measuring Range Module used to change the measurement types and ranges.
PI: Peripheral Input.
PQ: Peripheral Output.
Note: The analog input and analog output modules use the integer word format to save the data.
Scaling Analog input values
In general, the values read from an analog input are stored in a memory word. Sometimes you
are required to convert these values to an appropriate format to use them in the program in order
to do a correct decision according to the actual input voltage, this operation is called scaling. The
first way to scale the stored values is to use mathematical operations to scale down the input
value to its original voltage input value and display it on a memory, see figure 3.

2
Mechatronics Systems Design Lab

Figure 3: Mathematical operations scaling

In the previous ladder logic program, the input voltage read from input PIW512 is divided by
2760. When the input voltage is 0V the value stored in MD200 will be zero, and when the input
voltage is 10V the value stored in MD200 will be 10.
The second way to scale down analog input values is done using the scale function (FC105). In
program object, in the left panel expand Library > Standard Library > TI-S7
Converting Block and select FC105 for scale the analog input, see figures 4 and 5.

3
Mechatronics Systems Design Lab

Figure 4: Standard library

4
Mechatronics Systems Design Lab

Figure 5: FC 105 scaling function

In the ladder logic program shown in figure 6, FC105 reads the integer value for analog input
stored in PIW512 (parameter IN). For this example, the state of M 9.0 (parameter BIPOLAR)
determines whether the input value is bipolar or unipolar. Because the value of M 9.0 is 0,
FC105 processes the analog input as a unipolar number (0 to 27648). FC105 converts the integer
value to a real number, FC105 scales the Real number to a value between 0.00 (parameter
LO_LIM) and 10.00 (parameter HI_LIM). If the function is executed without error, FC105 sets
the RET_VAL (MW100) to W#16#0000 (hexadecimal). If the input integer value is greater than
27648 or less than 0, FC105 sets the output (OUT) to 10.00 (HI_LIM) or 0.00 (LO_LIM),
respectively. FC105 also returns an error by setting the RET_VAL to W#16#0008
(hexadecimal). FC105 stores the scaled value in MD200 (parameter OUT).

Figure 6: FC 105 scaling function example

5
Mechatronics Systems Design Lab

Equipment
1. Siemens S7-400 PLC.
2. Computer.
3. Potentiometer.
4. LEDs.

Procedures
Part 1: Controlling the brightness of an LED using potentiometer
1) Connect the circuit shown in figure 7.
2) Write a ladder logic program to control the brightness of the LED using the potentiometer
reading. See figure 8.
3) Download the program to the PLC.

Figure 7: Controlling the brightness of an LED using potentiometer

Figure 8: Ladder diagram to control the brightness of an LED using potentiometer

Part 2: Write down a ladder program using comparators to turn on an LED when the
input voltage value reaches half its maximum value (make sure the input values are scaled),
then connect the proper hardware and execute the program.

Part 3: Write down a ladder program using comparators and mathematical operations that
controls the brightness of an LED; such that it starts with high brightness and when the
maximum value of the input potentiometer is reached the LED is turned off.

6
Mechatronics Systems Design Lab

Part 4: Write down a ladder program that uses a potentiometer and do the
following:
1- When the potentiometer reaches 25% of its value the program turns on one LED.
2- When the potentiometer reaches 50% of its value it turns on another LED.
3- When its reduced below these values the LEDs are turned off.
4- Use an analog output and connect it to an LED and let it show the variations in brightness
while changing the value of the potentiometer.

Discussion and Conclusions

1) What are the purposes of using analog input and analog output modules?

You might also like