A-B SLC 500 Count Down Instruction Problem

Shawn

Member
Join Date
Oct 2003
Posts
24
Hi Masters,

I encountered a problem with Count Down of A-B SLC 5/01.Accum always be 0, but the Preset always be a plus. How the Accum can reach Preset??

I tried to set up Preset as a minus or making Accum be greater than preset, but the PLC didn't accept this arrangement.

Thanks
 
I put a nomal open instruction befor the counter

The counter can be count down, but it never can reach the preset because the accum is going to be less than preset.

Thanks
 
I am confused

Description
This output instruction counts down for each false-to-true transition of conditions preceding it in the rung and produces an output when the accumulated value reaches the preset value. Rung transitions might be triggered by a limit switch or by parts traveling past a detector.

Each count is retained when the rung conditions again become false. The count is retained until a RES (reset) instruction with the same address as the counter is enabled, or if another instruction in your program overwrites the value.

The accumulated value is retained after the CTU or CTD instruction goes false, and when power is removed from and then restored to the processor. Also, the on or off status of counter done, overflow, and underflow bits is retentive. The accumulated value and control bits are reset when a RES is enabled.

Counter files use three words per element.

Instruction Bits: 11 = UN (count down underflow) bit
13 = DN (done) bit
14 = CD (count down enable) bit
The CD bits are always set prior to entering the REM Run or REM Test modes.

I dont understand what you are trying to do...how can the accumulated value never reach preset?...the only situation I can think of is if you RESET the counter at another value prior to preset.

IF you need to use a value that is NOT the preset of a counter then use the EQU, NEQ, or LEQ etc function for the value needed and allow the counter to count to the preset value...then if the count down enable bit is needed it can be used.
 
Shawn

My experience with CTD instructions are reversing the CTU with the same address. For example counting bottles up to a counter going into a rejector with one sensor and down to the same address with a sensor on the discharge side of the rejector will let you know if an excessive amount of rejects has occured. You can probably use a count up and trigger the required result by using the .ACC value.

Rube
 
Shawn.

I think you are missing the purpose of the CTD instruction. My impression is you expect that if the CTD is reset, the ACC will go to PRE, and then every false-to-true change will cause the ACC to decrease until it hits zero, at which point the DN bit will come on.

While that's certainly a reasonable thing to expect, that isn't how it was designed. This is a little-used instruction that is intended to complement a CTU instruction. It is not intended to by used by itself. The CTU makes the ACC go up, the CTD makes the ACC go down. Reset always sets ACC to zero, and clears the DN bit.

Typically you would use this instruction to keep track of the number of parts between two photoeyes. When the first photoeye is blocked, the CTU increments ACC. When the exit photoeye is blocked, it triggers the CTD to decrement the ACC.
 
And just so you know, there is usually more than one way to
do something. In this case you don't have to use counters to do counting. You can use any integer with ADD or SUB instruction
(make sure input is a pulse) and comparison block such as EQU.
Don't worry about how other people do things (sure it's good
thing to know, though), make sure YOU can troubleshoot your code.
 
If you are going to count DOWN to a preset number you must start off at some number greater than your preset. You are not going to be able to count DOWN to a preset of 10 if you start with a Acc. value of 5.

Roger
 

Similar Topics

I have a program that I've used 100 times. SQO settings: File N7:0, Mask 0FFFFh, Dest B3:1, Control R6:0, Length 8, Pos 2. Length & Position...
Replies
48
Views
939
Everyone, i am in the process of purchasing the Slc 500 version of software to support what we have and i have a question. Several of our...
Replies
9
Views
751
In a slc 500 plc I am trying to move data with out using a lot of moves. I want to move data from n7:1 to n7:2 and data that was in n7:2 to n7:3...
Replies
16
Views
1,346
Customer has a circa 2004 SLC-500 PLC. Fieldbus is a 1747-SDN DeviceNet scanner. Customer has SLC-500 file (.rss) with no comments. Has no *.dnt...
Replies
7
Views
547
After I tried wiring, I used computer program communication to read the PLC N value, but received a NAK signal. And the DL3500 CHA light keeps...
Replies
0
Views
419
Back
Top Bottom