Totalizer program in S5 155U

gireesh

Member
Join Date
Jan 2006
Location
Al- Jubail
Posts
5
Hai,
Can anyone help me in programming a flow totalizer with an analog input of 4 - 20mA to a flow rate of 0 - 6200m3 / hr. I have tried to derive to a Data output (DD) by using FB 40, and am able to count the respective value one every 1 Sec pulse. I need help on adding the output value (every one second)which is derived by standard functional block (FB 40).
 
gireesh

Can you confirm that you wish to add the output value of FB40 (as you put it) to all the previous values, in other words you want a running total of all the output values.

I don't know FB40, what comes out of that? Is it just the number of counts since the last FB40 call, or is it what you are actually after, the running total?

If it is just the number of counts since the last call then it is fairly easy to give yourself the running total....

Something like:-

C DB40 //datablock where values are stored
L DD0 //output data from FB40 is written here
L DD2 //running total
+D //Add the two together
T DD2 //Transfer the result to DD2, running total.

I would check to see that FB40 has updated the output and I would also 'one shot' the addition logic, there are no one shots in S5, so you will have to 'roll your own'. For example

Seg 1
A F0.0 //FB40 has updated flag
AN F10.1 //This is your one shot flag
= F10.0 //One shot on

Seg 2
A F0.0 //FB40 has updated flag
= F10.1 //One shot flag

This post is "off the top of me 'ead", it might be of some help to you. But it will need refining.

Paul
 
Dear MR.Paul,

Thank you very much for your reply. I feel that you will be able to suggest more if I made my query more clear.

I mentioned Functional block (FB 40) which is used to convert analog signal to Data word. I mean, to display the output of the total flow transmitter on an HMI the same block has been used.
Maximum flow rate = 6200m3/hr
flow rate / second = 1.72222m3 if the transmitter out put is 20mA.
So when I call FB 40 and programm OGR and UGR as 0 - 1.722222, with an input flag (1Sec Flag), I am able to get an output Data word equivalent to the flow /sec. I need to add the same data with the next shot and convert to 32 Bit (DW) which I can display on HMI.

I hope you can provide me more better solution.
Regards,
Gireesh
 
gireesh

I got your email, but I will reply in this forum.

I just want to get some things clear, the output word from FB40 is the flow rate at the time of the call, but you want to constantly add these flow rates together to display the total flow for the period of time, correct?

How often are you going to reset this total?

I will still refer you to my first reply, the sample logic I have written there will suffice, providing you refine it a little. Short of taking this job on myself (which I am not going to do) I am not totally convinced I can help you much more.

Write your logic for this function, then post what you have written here and I (and others) will take a look at it and assist you more from there.

To add two words together and keep a running total is as simple as writing:-

L DW0
L DW1
+F
T DW1

DW1 will always contain the running total, DW0 will contain the value from the last call of FB40. Again the above is just an example, it will need refining to your needs.

Paul
 
Dear Mr. Paul

Thanks for your reply. I would like to note down the logic what I feel, and hope you will suggest any modification if required.
As I mentioned before,maximum flow is 6200m3/hr for an input current of 20 mA.
So,
FB 40
NAME: RLG: AE
***


PB 100 SEG 1

: C DB 100
***


SEG 2
: JU FB 40
NAME: RLG:AE
BG : KF + 160
P/Q : KS P
KNKT: KY 1,3
OGR : KG + 103333+02 (MAXIMUM FL0W FOR 6 SEC)
UGR : KG + 000000+02
EINZ: F 10.0 ( FLAG FOR 6SEC COUNT)
XA : DD2
FB : F 10.1
BU : F 10.2
TBIT: F 10.0
***


SEG 3

:JU FB 3
:L DD 2
:L DD 4
:+F
:T DD 4
***

SEG 4

: JU FB 10
NAME : DD TO DW
:
:BE

This is what I made. As I am beginner in programming s5, please correct the mistakes.

Regards,
Gireesh
 
Gireesh

You will have to try your logic out yourself, I cannot do that for you.

But, I did notice something within the logic you have written...

I see that your min and max input to FB40 are in KG (floating point format) so is the output (XA) also in floating point format?

If it is segment 3 should be +G not +F as you have written.

What you have written doesn't mean a lot to me, as I can't se what is in FB40, so the declarations mean nothing. I also do not know what is in FB3 (unconditional call in segment 3) or what's in FB10.

You really do need to write and test this yourself, you will learn more that way.

Maybe you could zip your program up and post it here, so that I and others could have a look at it, but please make sure that if you do that, the program is annotated properly.

Paul
 

Similar Topics

Hi, So we have a flowmeter installed but doesnt have a feature to send a pulse to plc for it to compute the total volume. I want to somehow...
Replies
3
Views
575
At my work place, I programmed a totalizer for one of the plants with OB35 which worked fine. I later took the same to another plant, it did not...
Replies
8
Views
2,995
So, I have a Siemens model 545 (TI) PLC. I need to program a simple totalizer but cannot find any reference material to get me started and Tech...
Replies
2
Views
5,168
How is it going y'all? So We have had a pesky problem with an EH 300 flow meter. We are using EIP to reset the totalizer, and for some reason the...
Replies
3
Views
794
Good morning, I have a flow meter that has an output pulse configured to 378.541 liters per pulse. My question is, do I just count the pulse per...
Replies
19
Views
1,804
Back
Top Bottom