Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog and digital output synchronization with external sample clock

Solved!
Go to solution

Hello,

I am trying to program similar setup, but this solution (printscreen attatched) doesn't seem to work for me (it's screenshot from forum, once I downloaded the program I changed all variables so that they are right for my setup), I get error  "200560 Wait Until Done did not indicate that the task was done within the specified timeout", also my previous approaches led me to the same error. I will appreciate your help, since I am beginner with LabView and I'm trying to solve this puzzle for a while now.

My device is DAQmx 6353. As external Sample Clock I use Function Generator with Pulse operating mode, frequency 100kHz, amplitude 3V, duty of 50% connected to PFI1 port. I connected 500Ohm resistance between generator and PFI1 to do not exceed current limit. What is important, I run pulse generation even before I start Labview program. In NI Max I see digital signal in port 0 line 16 (I have read somewhere that it should correspond to port mark, which is PFI1/P1.1 P port.line, but it looks like it doesn't). If I use Use Waveform in Timing it sends output signal.

What may be a reason for this error? Maybe I should use pulse signal as reference clock? I would appreciate your help.

Best Regards

0 Kudos
Message 11 of 14
(629 Views)

1. The error happens at a node that doesn't exist in your screenshot.  So you're running something different than what you posted.

 

2. Nevertheless, the error code is giving you a decent clue, have you searched for info about it?

    In the screencap, the AO task is configured for Continuous Sampling, so it shouldn't ever be "done".  Thus you get a timeout error instead.

    (The DO task defaults to Finite Sampling because the corresponding terminal was left unwired.  It'll then also use the default # of samples, which I think might be 1000 but am not certain offhand.)

    Note that the screencap doesn't use "Wait Until Done" but simply queries for "Is Task Done".

 

3. I don't know enough about what you're trying to do to give meaningful replies to other questions and comments.  

 

 

-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 12 of 14
(619 Views)

Hello Kevin,

Thank you for reply. Sorry, for being a little chaotic, I've send wrong screen. I enclose program screen only with AO part. I use "Finite Sampling" in AO, so it should end at some point and also changed "Is Done?" to "Wait Until Done". As I've searched for this timeout error I've found solutions like:

- increase timeout - I've changed it to 100s, doesn't work,

- reduce sample rate - changed it from 100k to 100 samples/sec with left 100kHz impulse generator signal and also changed to different value, doesn't work,

- check if external clock pulses are not noisy, so they won't cause extra edges - checked in NI Max few times that frequency of high/low states is right.

- Increase the number of samples you write each time you invoke a write operation - increased from 100 to 1000, doesn't

- reduce the umber of applications ran at the point of executing this program - took care of that

The thing is, I want to plug laser to DAQmx via PFI0, which will generate impulse signal and with each pulse, I want to send one AO sample for each of two AO channels I've pluged in to DAQ, AO will go to scanning devices and AO signal is trajectory of their movement.

I would appreciate your help.

 

0 Kudos
Message 13 of 14
(606 Views)

I quickly skimmed your device's spec sheet and didn't find any obvious signal incompatibilities.  Still, I'd suggest trying a clock source that's closer to TTL's nominal 5 V level rather than 3 V.

 

The code you just showed seems like it ought to function if it's getting a "good" clock signal.  You mention some checks in MAX (which seem sufficient) but have you also checked to see whether *any* of your analog waveform gets generated?  Another simple troubleshooting step is to either (A) let the AO task generate its own internal sample clock, or (B) create a clock with an onboard counter that exports its output signal to PFI0.

 

Here's a couple small comments on the code that shouldn't have any bearing on your specific problem at the moment, but are worth understanding for future purposes.  The query for sample clock rate isn't really helpful when you're using an external source -- it'll just tell report back whatever you told it.  Also, triggering off the same signal that acts as an external clock isn't particularly useful -- you could remove the call to DAQmx Trigger.

 

 

-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 14 of 14
(600 Views)