Capturing a count

showshocka

Member
Join Date
Mar 2011
Location
USA
Posts
510
This is similar to a post I made last week, close, but not the same. I'm looking for a way to capture and send a value of a CTU.ACC that is being counted up by a digital input, and to have that value captured and moved using a MOV instruction, that ACC Value right before the CTU is reset to Zero. The CTU is timed and resets after 3 seconds, so when the first push button reset for that CTU is made true, I use that same Push button input for a one shot OTE's XIC to make the MOV true and it seems to work only while the one shot is active for that one scan. The ACC Value does move using the MOV but after the Counter is reset after that 3 seconds, the Value that was in the MOV goes back to Zero along with the new reset Value of Zero, the same as the CTU.ACC. My Question is; how does the Value in the MOV Change along with the CTU reset if the one shot only made the MOV rung true for only one Scan, which is far less time than 3 seconds. I hope I made good sense with this is one. Thanks.

practice.jpg
 
I cannot read your picture at all. Either up the zoom level before making a screen capture, 'printing' to a PDF and attaching that or zipping and attaching this section of the program.
 
Break it down into the 4 things you need to do:
1) Add 1 to a number every time a digital input goes high:
Normally open contact for your input, one-shot (rising) to make sure that it only happens 1 each time the signal goes high (instead of every scan that the condition is true), and then ADD 1 to an integer called "COUNT". I personally never use CTUs. Call it preference.

2) Move the accumulated value into a holding register when the timer is done. Normally open contact for TIMER.DN, move "COUNT" into another integer

3) Reset your counter to 0 when the timer is done. Normally open contact for TIMER.DN, move 0 into "COUNT"

4) A timer that counts for 3 seconds. I assume this means you want a timer that counts for 3 seconds and then resets itself.
Normally Closed contact with TIMER.DN leading to the timer itself (TON). This means every time the timer is done, the DN bit will be true for a single scan, and the timer will restart.
 
Is your ONS getting fired twice? Once when you initially set Push_Button_Reset and again after 3 seconds+1 scan when the .DN XIO makes?

I assume your Push_Button_Reset is maintained? Make it momentary and latch around it with the .TT bit of the timer.

And really unless you need the 3 second timer, you could accomplish the MOV and reset as parallel outputs on the same rung as your Push_Button _Reset.
 
Use the Windows snipping tool, save the capture, then upload it. Don't do any size modifications beyond that.
 
Use the Windows snipping tool, save the capture, then upload it. Don't do any size modifications beyond that.
One problem is that the attachment feature seems to shrink images down in resolution. I have taken screen captures at full resolution and uploaded them here through an attachment, and when you try to view them they are tiny or blurry and you can't make things out.

I think screenshots in general are a bad way to do it. I've used a program called PDF995 to print things to PDF files. I'm sure many others exist.
 
I cannot read your picture at all. Either up the zoom level before making a screen capture, 'printing' to a PDF and attaching that or zipping and attaching this section of the program.

How about this? Though I understand the instruction I've never used an OSR

practice capture.jpg
 
If you want to copy the accumulated Count_up.ACC before it is reset, place the MOV instruction on the same rung as, but prior to, the RES instruction. No ONS required.

Your current code one-shot-rises a MOV flag, then performs the MOV, sure. But it depends on the Reset_Timer.DN bit, which rung 0 also looks at. Do you see how the reset occurs before your copy?

Is your attached image a .JPG or .PNG file? If it's the former, try snipping and saving as the latter, then uploading.
 
Last edited:
I'm posting this before I go back and read through the :unsure::confused: from you gentleman about my last post ....I did some more reading and then, this is what I came up with. Works like a Charm for what I was trying to do. What do you guys think? I'm studying on everything else that has been suggested also. Just have to study more to implement it. Thanks

practice capture.jpg
 
Last edited:
If you want to copy the accumulated Count_up.ACC before it is reset, place the MOV instruction on the same rung as, but prior to, the RES instruction. No ONS required.

Your current code one-shot-rises a MOV flag, then performs the MOV, sure. But it depends on the Reset_Timer.DN bit, which rung 0 also looks at. Do you see how the reset occurs before your copy?

Is your attached image a .JPG or .PNG file? If it's the former, try snipping and saving as the latter, then uploading.

Yep, I sure do. Excellent!
 

Similar Topics

Hi everybody please see attached image for problem illustration. Kindly suggest possible solutions :)
Replies
3
Views
1,859
Hello. I actually still have a customer that has a 486 running a DOS program controlling a press. My task, convert it to an AB PLC and PV+. I am...
Replies
24
Views
1,892
is it possible to capture a value while its constantly changing then taking its highest reading? I have a nozzle that sprays for 10 seconds. I...
Replies
14
Views
3,479
Hey all, First time poster looking for a little help. I have a Kinetix 6000 drive that I am capturing faults for in RSLogix but I need some help...
Replies
0
Views
980
Hello PLC Experts, I want to do a logic where in an analog value will be captured per second or in any time possible and move that value into a...
Replies
2
Views
1,627
Back
Top Bottom