Author Topic: interrupt input  (Read 7299 times)

kizor

  • Newbie
  • Posts: 15
    • View Profile
interrupt input
« on: December 21, 2008, 02:24:32 AM »
Hi

In My progam I have a counter running that count the power consumption.Therefore I use input #5  and  a counter count's the pulses,when that counter reach his preset value it switch on a other counter en so on so that i become a counter with 7 digits(99999,99)
That works fine but because I loose some counts I try to use the interrupt input
Now input #5  turn on CusFn#1 ( intrdef 3,10,1)
In CusFn#10 I place  ctrpv[9] = ctrpv[9]+1
(counter[9] count's the pulses)

The interrupt input seems to work but the counter doesn't switch over on the preset value but  still count's on.
I have try everything but I can't figger out what I have to place in CusFn#10 so that (counter[9]) switch over on his preset value

Is there someone who can help to figger this out

Thanks in advance
    Kizor

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re:interrupt input
« Reply #1 on: December 21, 2008, 06:06:49 PM »
If you increment a counter value inside a custom function, it will not trigger the output when it reaches the S.V.  The regular counter S.V. is only processed in ladder logic and not in custom function.

Since you need a bigger counter you can always define counter #5 as a high speed counter and therefore it is a 32-bit counter. You can also define it such that when the counter reaches a certain value it will run a custom function which you can turn on some outputs.

Another way is not to use CTRPV[9] but just use any 32-bit variable (A to Z or EMLINT[1] to EMLINT[16]) as your counter. That way you are not limited to the range 0-9999.

Email: support@triplc.com
Tel: 1-877-TRI-PLCS