Programming a analog input

ed.kelly

Member
Join Date
Jan 2009
Location
alabama
Posts
19
Can someone give me a programming example of an analog input using Simatic manager. I am using CPU 314 IFM. Im need to get a 0-10 vdc input from a pressure transducer for a bottle leak checker.I also am using a OP3 interface. I prefer LAD language examples. Thank you.
 
Hi,

The easiest way would be using fc105 from the TI-S7 conversion library (included in Step 7).

CALL FC 105
IN :=PEW256 //Analog input address
HI_LIM :=1.000000e+002 //Max scaled value
LO_LIM :=0.000000e+000 //Min scaled value
BIPOLAR:=FALSE
RET_VAL:=DB4.DBW0 //Diagnostic value
OUT :=DB4.DBD2 //Output value

The analog input itself must be parametrized correctly with the hardware configuration toolof Step 7.

I hope it helps.
 
Thank you for your help, but I have another question. I found another example but this one uses FC10. Here is the STL. Maybe you can explain what they are doing here.

CALL FC 10
IN0:=PIW128
IN1:=MW4
IN2:=MW2
OUT3:=M255.0
OUT4:=DB20.DBD66
 
Thank you for your help, but I have another question. I found another example but this one uses FC10. Here is the STL. Maybe you can explain what they are doing here.

CALL FC 10
IN0:=PIW128
IN1:=MW4
IN2:=MW2
OUT3:=M255.0
OUT4:=DB20.DBD66

In order to understand what FC10 does,Ineed teh listing of FC10. I would guess that FC10 does something similar as the FC105, but it has lost it's documentation, so the inputs are named INx and the Outputs OUTx. If you send me the listing of FC10 I may help you. Anyway, you may use the FC105 supplied by Siemens.

Regards,

Clemens
 
Hi,

The easiest way would be using fc105 from the TI-S7 conversion library (included in Step 7).

CALL FC 105
IN :=PEW256 //Analog input address
HI_LIM :=1.000000e+002 //Max scaled value
LO_LIM :=0.000000e+000 //Min scaled value
BIPOLAR:=FALSE
RET_VAL:=DB4.DBW0 //Diagnostic value
OUT :=DB4.DBD2 //Output value

The analog input itself must be parametrized correctly with the hardware configuration toolof Step 7.

I hope it helps.

Hi ed. FC105 is a standard "Scale" block that you can use.(It is protected, so dont bother trying to look inside!)
The hi and Lo limits are in engineering units so if this is displayed in ladder it is just a square box with the tags around it. Highlight the tags and type in what you want. In the example given the input is being scaled between 0 - 100. (Type 100.0 for 100) The scaled output is being sent to DB4.DBD2.
Use a "Double compare" greater/equal to/less than to signal the leak, increase the pressure etc. If you want an archived "Ladder" file sent, I can, but it will be tomorrow!!

Hope my twopenneth helps!
 
Last edited:
Markie, that would be a great help. This is my first attempt at a program involving analog signals, and operator interfaces. I guess a leak checker was probably not the best first project.
 
Markie, that would be a great help. This is my first attempt at a program involving analog signals, and operator interfaces. I guess a leak checker was probably not the best first project.

Hi Kelly,

This would be an examplein LAD.

Hope it helps

Pressure.jpg
 
Ed,
When you have "Dragged" the analogue card from the hardware catalogue into the relavent slot on your backplate in the Config manager, you have to open it and select the correct range (o-20mA, 4-20, 0-10v etc). This has to match the setting of the selector plug on the side of the analogue card. It is easy to get them 180 degrees out!!!
 
The card is part of the CPU. Im using a 314 IFM (Intergrated functions Mod) So my hardware config just shows the CPU. It has I from 124-155, and Q
 
Clemens
In the LAD example you gave me I see that you used a NO contact labeled #bit to to energise -(R)- labeled #bit to set the Bioplar in FC105 to 0. What would be a condition to energise that rung in network 1?

You also put the FC105 SCALE operation in FC 4. Does that mean I need to make a call in OB1 to FC105, as I do for FC 4? Or since the scale operation is in FC4 then the only call I will need is the call to FC4.

Im still a little confused on the HI_LIM, and LOW_LIM. For example my input range from my transducer is 10mvdc = 0 bar. 10vdc = 333 bar. My max filling pressure is 230 bar, and a good test is is 206.8 mbar. How would this be entered into FC 105?
 
Clemens
In the LAD example you gave me I see that you used a NO contact labeled #bit to to energise -(R)- labeled #bit to set the Bioplar in FC105 to 0. What would be a condition to energise that rung in network 1?

That rung is only used to ensure #bit is false when FC105 is called. To ensure that FC105 will treat the analog value as 0-10vdc.
If you have a bipolar signal, -10 to +10 vdc, the #bit should be true.


You also put the FC105 SCALE operation in FC 4. Does that mean I need to make a call in OB1 to FC105, as I do for FC 4? Or since the scale operation is in FC4 then the only call I will need is the call to FC4.

You only call FC4

Im still a little confused on the HI_LIM, and LOW_LIM. For example my input range from my transducer is 10mvdc = 0 bar. 10vdc = 333 bar. My max filling pressure is 230 bar, and a good test is is 206.8 mbar. How would this be entered into FC 105?

HI_LIM = The maximum value the analog signal can give. In engineering units. If for you 333 bar is 10 vdc, then you put 333.0 in HI_LIM.

LOW_LIM = The minimum value the analog signal can give in engineering units. If for you 0 bar is 0 vdc, then you put 0.0 in LOW_LIM
 
Last edited:
Clemens
In your ladder example. How would I take the OUT_#PRESSURE, and display it in the ladder program as a 3 digit interger?

Which of the outputs is the actual reading of the analog input.
I want to be able to see what the pressure reading from the transducer is as it is filling.
 
Clemens
In your ladder example. How would I take the OUT_#PRESSURE, and display it in the ladder program as a 3 digit interger?

Which of the outputs is the actual reading of the analog input.
I want to be able to see what the pressure reading from the transducer is as it is filling.

Hi Ed,
I see Jebs answered some of your questions. There is a little thing you must consider with the low value of your measurement. I see that your o pressure value corresponds to 10 mV. So you must extrapolate tofind the value corresponding to 0mV. That low value would be -0,36634. (This is to increase exactitude.
The output #Pressure from FC105 is the measured pressure in engineering value (real pressure). This value is compared in the next segment to a limit value. If the pressure falls under this value,the signal A0.0 will be activated. This signal would indicate underpressure.
 
Hi Ed,
I see Jebs answered some of your questions. There is a little thing you must consider with the low value of your measurement. I see that your o pressure value corresponds to 10 mV. So you must extrapolate tofind the value corresponding to 0mV. That low value would be -0,36634. (This is to increase exactitude.
The output #Pressure from FC105 is the measured pressure in engineering value (real pressure). This value is compared in the next segment to a limit value. If the pressure falls under this value,the signal A0.0 will be activated. This signal would indicate underpressure.
To see the pressure value as integer it must be converted first to a long integer (L#245, 32 bit) and then to an integer (see picture).
I hope it helps.

PressureInt.jpg
 

Similar Topics

In this sample programming, what does U4 mean? Any assistance would be greatly appreciated.
Replies
8
Views
261
This is my first Siemens PLC programming. I got a PLC 315-2DP with 1 DI, 1 DO and 1 AI modules. I have already configured the modules and then...
Replies
7
Views
10,574
DEAR ALL, PLEASE KINDLY HELP ME, TO WRITE PROGRAM FOR ANALOG INPUT(4-20mA). I AM USING MITSUBISHI PLC FX3U-4AD-ADP MODULE. PLC SOFTWARE IS GX...
Replies
6
Views
7,573
Hello , i would like some help on how to program analog inputs , 4-20 ma , 0-10vdc using slc 500's......if anyone could show me as far as do you...
Replies
4
Views
2,280
I am trying to measure a DC current going through a DC motor. I have installed mlogix1500 with an analog input card and 0-10 volts current...
Replies
9
Views
2,868
Back
Top Bottom