DI counter function
Hi,
We purchased the RevPI Core 3. It works great.
I noticed that you have DI-cards where you can configure the inputs as a counter function. How does it work? Does this card have its own counter controller where we ask/reset the countervalue on request or do we have to do the counting by ourselves in the software? What is the maximum frequency of the counter cards?
Thanks already for your reply.
BW
We purchased the RevPI Core 3. It works great.
I noticed that you have DI-cards where you can configure the inputs as a counter function. How does it work? Does this card have its own counter controller where we ask/reset the countervalue on request or do we have to do the counting by ourselves in the software? What is the maximum frequency of the counter cards?
Thanks already for your reply.
BW
Hi,
our DIO and DI Modules have 14 and 16 input terminals. Using the graphical configuration tool PiCiory (it runs on the integrated Webserver) you can configure each terminal to work as a counter input. The Modules do the counting job for you and our driver PiControl cyclically gets the count value (vie PiBridge bus) into the central process image (32 bit signed values). You can also reset the counters using an ioctl call. As an alternative you can configure a pair of input terminals as A/B inputs of a phase encoder sensor and you will get the encoder count in the process image too.
Count frequency is up to 2 kHz but process image refresh intervall is only 10 to 40 ms depending on the configuration and the bus traffic generated by this system configuration. So if your application needs to use the count as an exact control to start or stop any actuator you should have count frequencies below 25 Hz to get the reaction on the exact count.
our DIO and DI Modules have 14 and 16 input terminals. Using the graphical configuration tool PiCiory (it runs on the integrated Webserver) you can configure each terminal to work as a counter input. The Modules do the counting job for you and our driver PiControl cyclically gets the count value (vie PiBridge bus) into the central process image (32 bit signed values). You can also reset the counters using an ioctl call. As an alternative you can configure a pair of input terminals as A/B inputs of a phase encoder sensor and you will get the encoder count in the process image too.
Count frequency is up to 2 kHz but process image refresh intervall is only 10 to 40 ms depending on the configuration and the bus traffic generated by this system configuration. So if your application needs to use the count as an exact control to start or stop any actuator you should have count frequencies below 25 Hz to get the reaction on the exact count.
Unser RevPi Motto: Don't just claim it - make it!
Hi Volker,
Thank you for your reply. The counting function works perfect.
Another question: is it possible to stop and restart a counter (enable, disable) by use of phyton script?
Thanks already for your support.
Thank you for your reply. The counting function works perfect.
Another question: is it possible to stop and restart a counter (enable, disable) by use of phyton script?
Thanks already for your support.
Yes, using n ioctl call to piControl can reset any counter. I will try to organize more informatiuon about how to use this ioctl call (parameters etc.)
Unser RevPi Motto: Don't just claim it - make it!
Hi Volker,
Let me clarify: I'm also interested in resetting the counter but I would like to enable/disable the counter.
E.g. the counter has a value of 308. When I disable the counter, the pulses are ignored as long as the counter is disabled. As soon as I re-enable the counter, the value starts counting from value 308. Is this possible?
Thanks in advance.
Kind regards.
Let me clarify: I'm also interested in resetting the counter but I would like to enable/disable the counter.
E.g. the counter has a value of 308. When I disable the counter, the pulses are ignored as long as the counter is disabled. As soon as I re-enable the counter, the value starts counting from value 308. Is this possible?
Thanks in advance.
Kind regards.
Sorry but if I'm not out of date with my information this should not be possible with our ioctl functions at the moment. Please wait until Mathias has explained the ioctl and if it is really not possible with the current driver you could please set this in the Forum "Wunsch- und Ideensammlung" (please feel free to post in English although this is the German part of the Forums).
Unser RevPi Motto: Don't just claim it - make it!
Hi,
there is an ioctl-call to reset the counters/encoders.
For example, if you use one DI on the right side of the RevPi, it will have the address 32. The address is displayed in pictory.
If you configured Input I_3 and I_4 as counter and want to to reset (set them to 0) them at the same time, you have to make the following call:
SDIOResetCounter tel;
tel.i8uAddress = 32;
tel.i16uBitfield = 0x0c;
ret = ioctl(PiControlHandle_g, KB_DIO_RESET_COUNTER, &tel);
You will find the whole example in the demo-1.zip file in our download area.
It is not possible to stop an continue a counter, all you can do in current version is to reset it.
Please keep in mind that you can use only 6 counters at the same time.
Unforunatlly this is C, not python. I never used python so I cannot help you with that. Maybe you can find an example how to call an ioctl on the page https://revpimodio.org/en/homepage/
Mathias
there is an ioctl-call to reset the counters/encoders.
For example, if you use one DI on the right side of the RevPi, it will have the address 32. The address is displayed in pictory.
If you configured Input I_3 and I_4 as counter and want to to reset (set them to 0) them at the same time, you have to make the following call:
SDIOResetCounter tel;
tel.i8uAddress = 32;
tel.i16uBitfield = 0x0c;
ret = ioctl(PiControlHandle_g, KB_DIO_RESET_COUNTER, &tel);
You will find the whole example in the demo-1.zip file in our download area.
It is not possible to stop an continue a counter, all you can do in current version is to reset it.
Please keep in mind that you can use only 6 counters at the same time.
Unforunatlly this is C, not python. I never used python so I cannot help you with that. Maybe you can find an example how to call an ioctl on the page https://revpimodio.org/en/homepage/
Mathias
-
- Posts: 2
- Joined: 17 Dec 2018, 20:04
Hi, for 25 Hz as counter, is it still reliable to assume 25 Hz when using all 16 inputs of DI?volker wrote: ↑30 Aug 2017, 22:37 Hi,
our DIO and DI Modules have 14 and 16 input terminals. Using the graphical configuration tool PiCiory (it runs on the integrated Webserver) you can configure each terminal to work as a counter input. The Modules do the counting job for you and our driver PiControl cyclically gets the count value (vie PiBridge bus) into the central process image (32 bit signed values). You can also reset the counters using an ioctl call. As an alternative you can configure a pair of input terminals as A/B inputs of a phase encoder sensor and you will get the encoder count in the process image too.
Count frequency is up to 2 kHz but process image refresh intervall is only 10 to 40 ms depending on the configuration and the bus traffic generated by this system configuration. So if your application needs to use the count as an exact control to start or stop any actuator you should have count frequencies below 25 Hz to get the reaction on the exact count.
Hi,
you can use only 6 counters at the same time.
Therefore 25 Hz are realistic.
Regards,
Eduard
you can use only 6 counters at the same time.
Therefore 25 Hz are realistic.
Regards,
Eduard