Page 1 of 1
Counter synchronisation
Posted: 10 Aug 2023, 15:42
by alexsf
I'd like to use the DI module to count pulses from two devices at the same time. I don't think it is critical that I start counting at a particular moment but it is very important that the two counters are synchronised so that they both start counting at the same time.
I can't find anywhere how the counters work and whether this is possible. Can anyone tell me?
Thanks
Re: Counter synchronisation
Posted: 11 Aug 2023, 08:48
by kjkoster
Dear Alexsf,
Is it not heaps easier to just do that in software? As you the system boots, you read both counters at the same time and store that as the offset. Then each cycle you read both counters at the same time, subtract the offset and you have clean, reliable counts since boot.
Kees Jan
Re: Counter synchronisation
Posted: 11 Aug 2023, 10:13
by alexsf
Thanks for the reply, yes this could be a way to do it but a similar question applies then, how synchronised are the channels when the counters are read?
You can imagine that if I'm counting 1.5kHz pulses and I read two counters but the reads of the hardware are off by 10ms then that's a 15 count error which may or may not be acceptable for the application. I think for our application we may be able to cope with less well synchronised counting than I initially thought but I would like to know what is achievable so I can work out what sort of errors I can expect due to this.
Re: Counter synchronisation
Posted: 11 Aug 2023, 13:16
by kjkoster
Dear Alexsf,
That I do not know, though I am curious to learn. I guess we'll have to wait what one of the Kunbus experts has to say on the topic.
Kees Jan