Sign in to follow this  
Followers 0
ritzspeed

Conditional increment after every five seconds

9 posts in this topic

I want to build a logic in ladder diagram in RSLogix 5000 v16/v17 where an analog output is intially set to 10%. Two analog inputs are continuously being read and being compared to some respective threshold values, and if any of these two inputs are less than their respective threshold values, the PLC has to increment the analog output by 2% every 5 seconds. The effect of the analog output increment is reflected on this two analog inputs. If both the inputs reached their respective threshold values, turn on an LED lamp. Let me make it simple to understand: Let A = analog input1 B = analog input 2, C = analog output initially C = 10 after 5 seconds if A < 22 OR B < 36, then increment C by 2% if A < 22, B = 36, then increment C by 2% if A = 22, B < 36, then increment C by 2% and if A = 22 or greater and B = 36 or greater, turn on LED lamp do this (increase C by 2 %) every 5 seconds until both the inputs are equal or greater than their threshold values, i.e. A = 22, B = 36. The analog output must be set at increased value until next increment is given I've tried this using timer, timer done bit, timing bit, enable bit all, but did not success. The PLC doesn't increment after 1st increment, my logic is faulty. Any help would be appreciated. Thanks :)

Share this post


Link to post
Share on other sites
We can assume the whole condition of A & B as one single input condition, which has to be satisfied to make an increment at output.

Share this post


Link to post
Share on other sites
It would be easier to help if you put up a screenshot of your logic

Share this post


Link to post
Share on other sites
Yes, we need to see your logic. You probably need to put the done bit as a normally closed contact in front of the timer so that it's self-resetting. But if you can show us what you've got, we can be more specific.

Share this post


Link to post
Share on other sites
I've been trying and deleting the previous logic that didn't work, so here is the latest what I have developed

Share this post


Link to post
Share on other sites
I know I might me doing very silly and major mistakes in the program, I'm still learning. I've made changes in threshold values, but the problem statement remains the same Edited by ritzspeed

Share this post


Link to post
Share on other sites
Your code looks fine, except for the first rung. You're moving 32 into VAR when INCDELAY is not done. That means for every five second cycle you're moving 32 in, then adding 2, which means it looks like the logic is only working once. Try disabling the first rung. You'll have to come up with some other way of initializing VAR.

Share this post


Link to post
Share on other sites
The ladder diagram looks a lot more complex than the description of the system seems to require. I see this: 1. Conditioned by 'first pass' (S:FS) MOV the 10% value (32) into the output holding tag. I would suggest using a REAL as the output holding tag. Then MOV the value to the actual output. It will keep just the rounded integer portion. 2. A self retriggering timer set to 5 seconds 3. On timer 'done' do the comparison and, if needed, increase the output holding tag by multiplying by 1.02 (if he really means 2% - he did say that 5 times - if not just do the add of '2' as he shows.) 4. If Compare shows both OK then turn on light. I can't determine what the 2 second timer is for. Edited by b_carlton

Share this post


Link to post
Share on other sites
As b_carlton mentions, your logic is more complex than needed. Try this (see picture). I used A, B and C tags just as in your functional description. Note that the "Begin" tag in my logic is just a bit, you'll need to decide when to turn that on.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0