06-24-2024 03:21 AM
Dear Forum,
I have an cDAQ-9174 connected to my win10 PC, with an NI-9403 card that reads hall sensors.
There is any way to make the digital input act as an "external interrupt" from a microcontroller rather than a "polling" by repeatedly reading it ?
Thank you
Andrei
06-24-2024 03:51 AM
06-24-2024 05:46 AM
Hi GerdW
Ideally I should be able to call a function to execute some tasks at the detection of a rising edge on the digital input . I need to read an absolute rotary encoder in this case with minimum time delay after the rising edge.
I am open to options if I can avoid continuously reading the DIO.
I expect to end up using an "event case".
From what I searched until now every time I need to execute a read of the digital input pin, and I hope is possible to avoid this.
Thank you
Andrei
Thank you
Andrei
06-24-2024 06:18 AM
Hi Andrei,
@Andrei_Hapenciuc wrote:
Ideally I should be able to call a function to execute some tasks at the detection of a rising edge on the digital input .
I expect to end up using an "event case".
In the DAQmx functions palette there is a submenu on "DAQmx Events": here you can try to setup an event to detect a "change event".
As I didn't use this feature so far I cannot tell if your specific hardware supports such events…
@Andrei_Hapenciuc wrote:
I need to read an absolute rotary encoder in this case with minimum time delay after the rising edge.
From what I searched until now every time I need to execute a read of the digital input pin, and I hope is possible to avoid this.
Define "minimum time delay": using a continuous task you may read samples at 10ms intervals if that is ok for you.
How is your cDAQ connected to your computer? The communication bus also influences communication speed (latency, throughput, …)!
06-24-2024 06:41 AM
Thank you GerdW,
I was afraid I would end up studying these "DAQmx Event" functions.
the cDAQ uses USB to comm with the PC.
10ms would be a maximum value.
Best Regards,
Andrei
06-24-2024 06:48 AM - edited 06-24-2024 06:48 AM
Hi Andrei,
@Andrei_Hapenciuc wrote:
10ms would be a maximum value.
When you need a reliable reaction time you should consider using a cRIO and even employing its FPGA capabilities. Especially for "maximal 10ms" time frames…
06-24-2024 08:12 AM
I agree with you, but I have a very limited buget and both FPGA license and cRIO are adding lots of K$