Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

finite samples save

hi,

i'm trying to create a program that writes a finite number of samples from a waveform (created from a general digital waveform generator which i made- that works fine) to an analog output channel and then reads in the same number of samples through an analog input channel and saves all this data to file.however, when i run the program, it comes up with an error and says:

Read failed, because there are no input channels in this task from which data can be read.

can anyone suggest any possible solutions to this problem?

steve

Download All
0 Kudos
Message 1 of 5
(3,066 Views)
Hi Steve,
 
I've taken a look at your VI and it seems that the wrong task is wired to the DAQmx Read VI. The analog output task is wired to the Read VI instead of the analog input task. I've attached my edited top level VI. 
 
Also, you can easily generate digital pulse trains using the counter output on the majority of our DAQ boards. You can configure the duty cycle, idle state, and frequency of the pulse trains. You can find code examples using example finder. Let me know which DAQ card you're using if you want to find out if this is possible.
 
Let me know if that helps!
 
Regards
 
Way S.
NI-UK Applications Engineer
 
Message 2 of 5
(3,043 Views)
hi way,
 
thanks for the help, i can't believe i made such a silly mistake.that seems to work ok now (it actually writes the data to file now).however, i've noticed another error crooping up in the program.despite the function generator i created seems to work fine (generating however many pulses i want in the pulse train)- when it saves the data to file it seems that it only shows the first spike/pulse and then rest don't get written to the file.so basically (although saying otherwise) my program has only one bit in the AI and AO data file where there is a pulse (at 0.8V say) and then the rest are not there, so the rest of the file shows 0V.i can't understand this at all, can you see a solution?
 
cheers,
 
steve
0 Kudos
Message 3 of 5
(3,032 Views)
hi way,
 
on second look, it seems it is working and writing the data to the AO and the text file.the only problem seems to be it doesn't srite the data to graph for finite samples, which i'm curious about but it isn't important for what i need.thanks for the help anyway.
 
best regards,
 
steve
0 Kudos
Message 4 of 5
(3,028 Views)

Hi Steve,

You should be able to see finite samples appear on your graph as well.  One thing I noticed on your VI is that you had a while loop on the Read VI while having the output and input tasks set on generating/acquiring finite samples. This will cause an error after the first iteration of the while loop with your current settings, because you will be trying to read extra samples that do not exist in memory (DAQ card would have finished and stopped acquiring data after first iteration).  

If you remove the while loop (or set it to run for only one iteration) when acquiring finite samples, they should appear fine on your graph (make sure you set your graph X and Y scales accordingly).

Let me know if that helps and if you have any more questions. 

Regards

Way S.

0 Kudos
Message 5 of 5
(3,016 Views)