Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

trigger digital output fast

Solved!
Go to solution

Hello,

 

Here is my problem: I want to generate digital samples (10 bits) each time I receive a digital external trigger.

That should be easy since I could even do it with the express DAQmxVI.

 

But the external trigger can go up to 120Hz and from 16Hz, the generation is not fast enough. It looks like the configuration of the digital output write takes to much time on each loop.

 

I am sure I am missing something... can anyone help me on that and/or point me to some documentation I could use ?

That would be very much appreciated.

Thanks,

 

R

 

PS: I am using a NI6351 USB card to get the external trigger on PFI0 and to genrate the digital data I want to send.

 

0 Kudos
Message 1 of 5
(5,697 Views)

Here is the Vi

0 Kudos
Message 2 of 5
(5,694 Views)

Why are you configuring and destroying your task each loop?  Set it up once before the loop.  Clear the task once after the loop.  Inside the loop you just need to run the task.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(5,691 Views)

Thank you for your answer but when I define the task before the for loop, keep write and start in the loop then erase after the loop, I got this:

 

"Attempted to write a sample beyond the final sample generated. The generation has stopped, therefore the sample specified by the combination of position and offset will never be available.
Specify a position and offset which selects a sample up to, but not beyond, the final sample generated. The final sample generated can be determined by querying the total samples generated after a generation has stopped."

 

Like in the second iteration there is a probleme with the start...

0 Kudos
Message 4 of 5
(5,687 Views)
Solution
Accepted by topic author Rochu

I have found the answer and share the link here:

 

https://decibel.ni.com/content/docs/DOC-25189

 

Thanks to Nathan-P !

 

Basicaly my NI USB6351 is not retriggerable, otherwise you just have to add a Daqmx trigger property node with retriggerable to true. But with this trick it works great !

 

R

0 Kudos
Message 5 of 5
(5,665 Views)