Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Digital trigger

I want to make sure that data from the channel is read (or written) when a signal comes to the trigger. Trigger is digital.
However, it turns out that the trigger does not work and the program waits for a signal, and then gives an error about a long wait. What am I doing wrong?

I tried to connect everything in series, but it did not help either.

KNikita_0-1648562909027.png

KNikita_1-1648563867978.png

 

 

0 Kudos
Message 1 of 6
(1,705 Views)

Please provide more details about the DAQ model, where does the Digital trigger come from and how is it connected to the DAQ? what is your overall goal?

 

Every experienced forum member would recommend ditching the DAQ Assistant and using the DAQmx drivers instead. This is a good article to start with but skip the DAQ assistant part - https://www.ni.com/en-us/support/documentation/supplemental/06/learn-10-functions-in-ni-daqmx-and-ha...

 

You can also convert the DAQ Assistant into equivalent DAQmx code by using the right-click context menu

santo_13_0-1648565046628.png

 

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 6
(1,701 Views)

KNikita_0-1648566371307.png

KNikita_1-1648566397389.png

 

Yes, I usually do as you pointed out. I just thought not to overload you with data and leave everything in the Assistant
All channels belong to the same device. In the future, I want to synchronize the signal output from different channels using a trigger (this is not here). Right now I'm just trying to figure out how to work with a trigger.
I want data to be displayed on the chart when the signal button is clicked.
Thanks for the quick response

 

0 Kudos
Message 3 of 6
(1,696 Views)

Your code for the AI task wants to see a digital trigger signal on PFI0.   If no such trigger signal is seen, the call to DAQmx Read will timeout after 10 seconds of waiting.

 

Your *description* on the other hand refers to a "signal button" being clicked.  I see nothing in the code related to a GUI button, do you actually have a physical button switch connected to PFI0?

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 6
(1,692 Views)

There is a button in the code, pressing which leads to the generation of a signal to the trigger channel (PF0 and port2/line0 it is the same physical channel). However, there is no signal on this channel while the program is running. Without a trigger, generation for this channel works.

0 Kudos
Message 5 of 6
(1,657 Views)

You're looking at P2.0 as a digital *input* and PFI0 as a trigger input.  Your digital output signal is going elsewhere to P0.0

 

Troubleshooting tip: sometimes when testing out how things work, it's good to bring up multiple shipping examples.  It's easy to check whether each one is working alone.  Then you can run 2 or more at once to force interactions.   In this case, you'd want an AI example that supports PFI0 triggering and a DO example that lets you toggle P2.0.

 

This helps narrow your troubleshooting focus because the code is already known to work.  Trying to troubleshoot and debug a screenful of code with multiple tasks that you built up from scratch is a lot more complicated b/c there are so many more possible ways for things not to work.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 6
(1,654 Views)