Sign in to follow this  
Followers 0
Damica

Need Help "No CPT" instruction available

7 posts in this topic

Can't seem to figure out best way to do this. I take a simple reading of analog input and store value in N7:0 (This value will be between 0-1023) Two minutes later I take another reading and if the value has changed up or down by 7.5% I want to call subroutine. I have subroutine finished and working. What would be the best way to get this done, I can't seem to figure out the solution, the "CPT" function is NOT available to me, I am using the micrologix 1100, rslogix500. Thanks

Share this post


Link to post
Share on other sites
Use a one shot of reading the value to trigger two MUL instructions. MUL N7:0 1.075 N7:1, MUL N7.0 .925 N7:2 (obviously you can pick any two integer locations other than N7:1 and N7:2 Then after reading the value a second time trigger a rung with a GRT compare in parallel with a LES compare to compare the new value to the computed limits.

Share this post


Link to post
Share on other sites
Thank you, I think that will work for my needs. I could not figure out to go about this and you provided a solution.

Share this post


Link to post
Share on other sites
Once Again, I don't completely understand! Will a One-Shot only run "Once Period"? Or can you reset it so that it will run once every let's say 20 minutes?? I need to read an "Address"(Store this information in that address) then 20 minutes later read same address again and compare it against something.) Then I need to read address again wait 20 minutes, read address again and compare. Or would I just use a timer to get this done? Do I really need a One-Shot? Thanks

Share this post


Link to post
Share on other sites
EMAIL_SAMPLE.pdf OK: Would you look at the first 4 rungs and tell me if this work or does something else need to be done.

Share this post


Link to post
Share on other sites
I appears that you want to compute the +/- 7.5% limits every 20 minutes but compare against that continuously. If so change the T4:2/DN contact in rung 1 to a NO (XIC) and delete the ONS. In rung 3 add an NC (XIO) of T4:2 in line with the timer. You may also want to establish a bit, set to OFF (OTU) at program start but set to ON (OTL) the first time the limits are calculated. Use that bit to condition the comparison since the limits may not have been set correctly yet. Edited by b_carlton

Share this post


Link to post
Share on other sites
Not for sure I have a grip on this YET. Yes, I do want to compare every 20 minutes, but I also want a fresh read of L12:0 every 20 minutes. So the logic flow will be like this, read L12:0 store in F8:0 compute a 7.5% increase of F8:0 and store in F8;1 compute a 7.5% decrease of F8:0 and store in F8:2 Now 20 minutes later read L12:0 again store in F8:0 and compare this reading((F8:0) to F8:1 and F8:2) to see if data has either increased by 7.5% or decreased by 7.5% This new reading of L12:0 stored in F8:0 is now what I will compute the 7.5% increase and decrease again and store in F8;1 and F8:2 Now 20 minutes later read L12:0 again store in F8:0 and compare this reading((F8:0) to F8:1 and F8:2) to see if data has either increased by 7.5% or decreased by 7.5% This new reading of L12:0 stored in F8:0 is now what I will compute the 7.5% increase and decrease again and store in F8;1 and F8:2 Thanks again

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