Omron counter weird-ity

RoTaTech

Member
Join Date
May 2003
Location
Cobourg, ON, Canada
Posts
418
This problem came up about a year ago, and no-one at Omron support could figure it out, so I thought I'd throw it to the wolves.
No urgency in reply, of course, just looking for thoughts...

yesterday I had a oddity - Omron CPM1A register went funny
This is a machine where an AC drive moves a piece of sheet metal along a conveyor under three different cutters - spaced out linearly. The conveyor movement is read by an encoder.

I had a couple rungs give me an hours headache:

LD 1401 @MOV DM50 DM51 ;load a preset number eg 5 into a countdown register
LD 20000 AND 1005 @SUB DM51 #1 DM51 ;countdown when in AUTO and cutter fires
...
(do something to request cutter) ...SET 20005 ;latch cutter request
...
(cutter routine)
LD 20005 DIFU 20105 ;one shot for cutter request
LD 20105 SET 20205 ;latch it in
LD 20205 TIM5 #3
LD 20205 AND NOT TIM5 OUT 1005 ;fire cutter for 1/2 sec
LD TIM5 RSET 20205 RSET 20005 ;done with cutter

worked beautifully, as it should.

Then I got the brilliant idea that I should add a timer before the cutter fires, to give the conveyor time to stop:

the code sample becomes:
LD 20005 TIM13 #5 ;1/2 sec delay for stopping
LD TIM13 DIFU 20105 ;one shot for cutter request
LD 20105 SET 20205 ;latch it in
LD 20205 TIM5 #3
LD 20205 AND NOT TIM5 OUT 1005 ;fire cutter for 1/2 sec
LD TIM5 RSET 20205 RSET 20005 ;done with cutter

this identical segment was added to 2 different punches, worked perfectly, as it should.

BUT, adding this timer to this particular segment (I removed it and problem would go away) caused the DM51 countdown to decrement by 2 instead of 1 !

I though I must be getting a double action from the cutter or something, so I added this:

LD 1401 @MOV DM50 DM51 ;load a preset number eg 5 into a countdown register

LD 20000 AND 1005 @SUB DM51 #1 DM51 ;countdown when in AUTO and cutter fires
CNT5 DM50
LD 1401 (to the counter reset input)
SO..., these 2 counters have the same input condition, right?

Now with the timer 13 still active, DM51 would dec by 2 and CNT5 would dec by 1!!

I solved it by just scrapping the SUB and doing a MOV CNT5 DM51, instead, but why do you reckon this happened???
 
Counting conditions for:
LD 20000 AND 1005 @SUB DM51 #1 DM51
works in every scan when true, but for: CNT5 DM50
it is dynamic (front edge of true) for Counter CNT5 property.
Could it be like that ?
 
Is this working ?
LD TIM5 OUT 'Memory'

LD 1401 @MOV DM50 DM51
CLC ?
LD 20000 AND 1005 @SUB DM51 #1 DM51 ;...
(do something to request cutter) ...SET 20005 ;latch cutter request
...
the code sample becomes:
LD 20005 TIM13 #5 ;1/2 sec delay for stopping
LD TIM13 DIFU 20105 ;one shot for cutter request
LD 20105 SET 20205 ;latch it in
LD 20205 TIM5 #3
LD 20205 AND NOT 'Memory' OUT 1005 ;fire cutter for 1/2 sec
LD 'Memory' RSET 20205 RSET 20005 ;done with cutter

 
Last edited:

Similar Topics

Hi! Omron CP1L. CX Programmer. How do I fix so that a CNTRX(548) remembers the count it had before a power failure? I need to know how many...
Replies
3
Views
1,389
Hi Folks. I have a problem with an Omron CPM2A-60CDT1-D High Speed Counter. It had been working well, the problem arose when a very minor program...
Replies
3
Views
1,464
Hi Folks. I have a problem with an Omron CPM2A High Speed Counter. It had been working well, but the problem is that a program change was...
Replies
2
Views
1,376
Hello all, new on here, and relatively new to plc programming. I am trying to write a program which counts as it receives a cycle end input, and...
Replies
4
Views
1,899
A simple task but beyond me. How do I set a counter in a ZEN controller to decrement? I'm using the Zen Support Software and the manual clearly...
Replies
19
Views
6,190
Back
Top Bottom