LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data acquistion using DAQ card

Solved!
Go to solution

Hello everyone

 

I need help with data acqusition from signal generator through DAQ card. I have connected signal generator to SCB-68 where analog input from generator is connected to AI CH5 and AIGRND of the terminal block. Then the output from the block is connected to the DAQ card . The maximum sampling rate of the card is 250kS/s. The problem is for some reason I am not able to see the waveform on the labview. I looked at other examples to find the problem, I am but I am not able to figure this out. I want to be able to choose the sampling rate. I have attatched my code as an attatchment for you all to help me find out what is the problem. Any suggestions will be appreciated.

 

 

0 Kudos
Message 1 of 7
(4,160 Views)
Solution
Accepted by topic author studentgirl

There is no Task!  You have not specified any hardware (i.e. your DAQ Card) anywhere.

 

Here's a suggestion.  Open MAX.  Find your DAQ device.  Open a Test Panel.  Set up a Continuous Sample of N Points at some Sampling Rate.  Push Run and convince yourself that you get data.

 

Now, while still in MAX, do Create Task, using the same settings.  Name it something sensible ("MyFirstDAQTask" is not a Good Name).

 

Now go back to your code.  Eliminate the first two DAQmx functions.  Wire a Task Constant to the DAQmx Start function.  See the little down-triangle?  Click it, and it should show you the Tasks it "sees", the only one should be the Task you just created in MAX.  

 

Note that "Visible Samples" is now "hard-coded" into the Task.  To get its value back out, you need to put a DAQmx Timing Property Node after the Start Task, and pull out the Sample Quantity, Samples per Channel (which, for reasons that escape me, is a Dbl, which you should convert to an I32 before bringing it into the While loop).

 

Bob Schor

P.S. -- thanks for attaching your code. 

Message 2 of 7
(4,152 Views)

Hey Bob,

 

I actually have the hardware connected it actually shows on my computer. It shows my card on it.

0 Kudos
Message 3 of 7
(4,124 Views)

@studentgirl wrote:

 

I actually have the hardware connected it actually shows on my computer. It shows my card on it.


I have no idea what you mean by this.  Are you talking about seeing your DAQ device in MAX?  Did you notice that there is no reference to your device in the code you posted?  My point was to show you a simple, step-by-step, method to make the "link" between the hardware, as seen by MAX, and the DAQmx functions, while at the same time saving a few steps by letting MAX do more of the work for you.

 

Bob Schor

0 Kudos
Message 4 of 7
(4,095 Views)

Aside from using max you can also use daq assistant to generate a simple task for you.  As bob stated above your task is not properly configured. You should ensure that the device is working in max before trying to debug in your application.  A device appearing in MAX doesnt always mean that it is working properly.



-Matt
0 Kudos
Message 5 of 7
(4,089 Views)

Hey Bob

Like you said I created the test panel in NIMAX to get the data as shown in capture. But I didn't get when you said to pull out the quantity for visible samples and convert it to I32 for while loop. I have attached my code for you to look at.

Download All
0 Kudos
Message 6 of 7
(4,038 Views)
Thanks Bob I think I got this working !
0 Kudos
Message 7 of 7
(4,020 Views)