Sign in to follow this  
Followers 0
pszczepan

Interrupt And Counter Mode

7 posts in this topic

I made program to count interrupts - it works but, f.e I set the SR240 to #A - 10 times counting and subroutine INC DM0. I'm testing my program with PLC and cable with 24VDC and each touch should be one interrupt, but I noticed that DM0 is increased more often then I expect ( I'm counting each IR0003 touch) My guess is that even I think I touched once - PLC counted more times. So how I can set the time of signal which can be counted - is something like that? In the PLC settings there is input Constant in the interrupt menu, but I have no idea how it works - I tried many different setups and I did not noticed any differences with intrrupt counting. Thanks in advance PAwel

Share this post


Link to post
Share on other sites
INC DM0 >> @INC DM0 !!? (says an interrupt n00b) nevermind need some sleep...

Share this post


Link to post
Share on other sites
I do not have @INC I had INC. When I changed it to @INC DM0 it did not work at all. My subroutine looks: LD Always_ON INC DM0 When I'm watching SR244 I see that even I touch IR0003 once the PLC decrement SR244 sometimes 1 sometimes 2 or 3. This I should change - signal duration: I looked at CPM1A manual and DM6620 -DM6623 should change input constant for IR. The question is - what difference is between IR00003 - DM6620 bit 04-07 and IR 003 -DM6622 bit 00-07. It is not clear for me. Pawel Edited by pszczepan

Share this post


Link to post
Share on other sites
If you set an input to be an interupt then as i understand it the input time constant is not applicable. Secondly if you a firing a subroutine then use an always on bit firing an INC instruction. Thirdly, you might want to check out this download i did a long time ago. CPM2A High speed counter with interuprts

Share this post


Link to post
Share on other sites
You have to do the correct setings in the DM area , then you have to use the INT fuction to set the counter. anyway Interrupt counters count just in down mode from a PV.

Share this post


Link to post
Share on other sites
IR00003 means input 000.03 (that's the one you want) IR003 means the range of inputs 003.00 to 003.11 Peter

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