
Trout914 (Customer) asked a question.
I have started working on the second PLC program in my system. This plc will take data from an EA9 HMI and control some valves through a Productivity 2000 and relay card. I made a simple program to test what I want to do. I am testing this with the the Productivity Suite simulator.
The first timer is the interval between valve openings and the second timer is for the duration the valve is open. After the timer runs, the valve opens and then a simple timer runs. When the second timer is finished they should reset and the valve close. Then the process should start over. The problem is to me it feels like holding the reset button down the whole time the second timer is running. This does not see right to me....?
Any thoughts?
The way it is written the the input must be held during the 5 second interval. If you want the process to continue cycling even though the input is released then you will have to latch it ( have the input set an internal bit and use that to enable the count up of the timer ). If you do that though you whould have to provide a way to release the latch if you don't want it to continue until the PLC is turned off (or at least taken out of run mode). Think about it and re-post with what you want to happen.
The cycle will be started by pressing a start/stopped with a button on the HMI, so you are correct there will be a latch circuit. This is just a proof that I can make the timers do what I want. The idea is a user enters a time between valve opening and how long they want the valve to stay open. Then press the start button. It should then cycle through those timers until stopped. What I have written does that, but it seems like a latch circuit where you have to hold the stop button down. Maybe that is OK, it just feels awkward to me.
Try this modification
TimerTest3
I couldn't decipher if you were trying to control the same valves on a loop (i.e. valve 1 opening and closing repeatedly) or if you were eventually going to move this towards controlling multiple valves in a sequence.
The attached file with "loop" in the name loops over and over until the stop button is pressed.
TroutValveLoop
This file loops and indexes a sequencer to open different valves with the same time intervals. It stops on its own when done. To make it a continuous loop, move the Valve Seq Dn bit out of first rung and into the 2nd as an NO OR.
TroutValveSeq
Yeah I was not very clear. This is a test sequence to make sure I am using the timers correctly and with best practices in mind. I will then repeat the process 46 times. Each system has two valves: a solenoid valve that doses feed, and an electric ball valve that introduces fresh water into the system. The user will want these two actions to occur at various intervals and duration depending on the species and density of animals in each system. So in a fish environment with low density the feed section would be turned off (we hand feed the fish), but the water change sequence will open the ball valve several times (set by the user)/day and leave it open for however long (set by the user). In a mussel system we will be doing both dosing food and changing the water. So for each valve there are two timers with the presets entered on the HMI, one to determine the span between openings and one to set the duration the valve is open. I need these events to continue until told to stop, either by stopping the sequence with the feed/water change buttons or by turning off that specific system. In my upload I have simplified it to just be about the timers using manually entered presets so I can test the looping and reset functions.
Does that help?
Thank you
I have fleshed this out a little and got the idea working in this example.
TimerTest3
But when I run this in a more complex environment the timers don't start. What am I overlooking? I need to study all the suggestions some more to incorporate them, but I thought this should work.
Thanks
CACRelay2.16.21vTest1
The timers ran for me, did you mean to have an input as a condition on the call rung in main? With both that input and the input inside ARelays toggled, it ran.
The simple timer had a typo, you have the set point at 1, if you want it to be the same as the original it needs to be 100 for 1 second.
AWaterValve is also used as an output twice so it will not turn on as you likely intend. It looks like you want the valve to open when there is a fault and then remain open for 50 seconds after? Give it a new name and use it as an NO contact as an OR on rung 3. Then either of those states will open the valve.
Try this
CACRelay2.16.21vTest2