Use of memory/marker bits in an FB on S7

You could write a simulation block that takes the Tank valves as inputs and internally generates an analogue tank level based on the time valves are open. You could also add some noise to simulate the ripple in the tank as it fills/empties. You would then use comparators to generate the boolean values for the level signals. You can write to inputs in your program if you do it at the start of OB1
 
Example tank simulation attached. I've used OB35 set to interrupt at 100ms for running the simulation block.
 
Here's your project with a working simulation for all three tanks (in OB35). I have only modified OB1 for simulating the relevant inputs.
I changed the times in DB100 so I didn't have to wait around as the sequence progresses. I had to modify the sensor wait time to 1s otherwise the tanks overfill with the simulation fill rates I have chosen.(choosing small fill rates means you have to wait for ages for the tanks to fill/empty)

The only unusual behavior is that the first time you run, tank 1 fills and then overfills slightly due to the timer. Second time around, tank 1 has already been filled to the overfilled level, but then gets overfilled even more due to the level timer - I had to raise the HIHI limit to prevent Tank 1 hihi alarms.
 
Here's your project with a working simulation for all three tanks (in OB35). I have only modified OB1 for simulating the relevant inputs.
I changed the times in DB100 so I didn't have to wait around as the sequence progresses. I had to modify the sensor wait time to 1s otherwise the tanks overfill with the simulation fill rates I have chosen.(choosing small fill rates means you have to wait for ages for the tanks to fill/empty)

The only unusual behavior is that the first time you run, tank 1 fills and then overfills slightly due to the timer. Second time around, tank 1 has already been filled to the overfilled level, but then gets overfilled even more due to the level timer - I had to raise the HIHI limit to prevent Tank 1 hihi alarms.

Thanks thats excellent I will have a good look at it this afternoon.
 
Here's your project with a working simulation for all three tanks (in OB35). I have only modified OB1 for simulating the relevant inputs.
I changed the times in DB100 so I didn't have to wait around as the sequence progresses. I had to modify the sensor wait time to 1s otherwise the tanks overfill with the simulation fill rates I have chosen.(choosing small fill rates means you have to wait for ages for the tanks to fill/empty)

The only unusual behavior is that the first time you run, tank 1 fills and then overfills slightly due to the timer. Second time around, tank 1 has already been filled to the overfilled level, but then gets overfilled even more due to the level timer - I had to raise the HIHI limit to prevent Tank 1 hihi alarms.

Hi L D[AR2,P#0.0];
what a program, works a treat, I have already found a few problems in my design, I have reduced the flow rate down to 300LPM and reduced the fluid settle timer in my prog to .5s and it all seems OK now.
By the way I have realised that my original problem was that on the recipe FB I had declared the nextstage var as an OUT and not IN/OUT so when I SET it, well you know the rest.

Regards Andrew
 

Similar Topics

I'm busy with my first CoDeSys project and as far as the programming itself is concerned, I was up to speed in a couple of days. The program is...
Replies
4
Views
5,949
I am kind of new to GE products, but we have several in my area. I made a minor logic change and it verified good, but when I tried to download I...
Replies
5
Views
47
Hi folks, I'm not as accustom with Siemens & WinCC, however I've been asked to increase the amount of data an existing application is logging...
Replies
2
Views
94
Hi, Yesterday, I was at a customer site. I made one little change. Changed a dummy bool output to an actual output. I didn't add any tags, or...
Replies
15
Views
378
I have a c-more micro with a three digit input box on one of the screens. This is being written to a memory location in a DL05. I don't have the...
Replies
3
Views
123
Back
Top Bottom