Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxReadBinaryI16 randomly returns no errors and no samples with 6111 card?

Hi,

I am using DAQmx 8.3 and the DAQmxReadBinaryI16 function through LabWindows/CVI (that is compiled into a C dll in Visual Studio 2005) to read data from a 6111 PCI card. I imported the function into a .NET project that uses C# as the primary language. When I initialize the board, I register a callback with DAQmxRegisterDoneEvent. The parameters are set up such that 10,000 data points (2 channels x 5000 data points) or less are collected at a rate of 50 Hz. A 50 Hz triangle waveform is generated from an AO channel on the 6111 that is then used (after processing in the device we manufacture) as an analog edge trigger set for the rising edge of the waveform. The triangle wave is collected on one of the AI channels and the other AI channel collects signal data. The collected data is then eventually displayed in a Windows form with a NI .NET WaveformGraph. After each call to DAQmxReadBinaryI16 the task is stopped then started again to achieve retriggering.

I recently noticed that a line at 0 is randomly displayed on the Waveform Graph. I traced this back to the call to DAQmxReadBinaryI16. What is happening is that the data array that is returned is full of 0 values, the return value of the function is 0 (indicating no errors occured), and the number of samples returned according to the function is also 0. If I reduce the number of samples collected, I get to a point were the 0 line on the Waveform Graph occurrs too quickly to be seen, but if I set a conditional breakpoint (break if the first three elements of the data array are 0) after the DAQmxReadBinaryI16 function call, the breakpoint is still hit and the results are the same.

Is what I am experiencing normal? If not, is there a known set of circumstances that cause this to occur? What about a knowledge base article on this?

Thanks in advance!

Best Regards,
Matthew

Message Edited by MatthewZ on 03-15-2007 04:55 PM

Message Edited by MatthewZ on 03-15-2007 04:56 PM

0 Kudos
Message 1 of 10
(4,678 Views)

Hello Matthew. 

Thank you for posting to the NI Discussion Forums. 

From what I understand, you are collecting data on 2 input channels of your 6111 card.  However, when you display the acquired points on a graph, an unexpected line appears on that graph at a seemingly random time.  Does this mean that you see 3 plots on the same graph: one that is the random plot and then 2 plots representing the 2 analog input channels that you are trying to measure?  If so, are the other 2 plots acccurate readings of the inputs that you are trying to sample? 

Can you also post some sample code that is stripped down (excludes other functionality not associated with this behavior), which still shows the odd behavior that you are talking about?  This would allow us to troubleshoot it a bit further.  I would also recommend double checking that your task configuration is only for 2 analog input channels. 

Let us know these details and we would be happy to help further!

Have a great day!

Brian F
Applications Engineer
National Instruments

0 Kudos
Message 2 of 10
(4,653 Views)

Hi Matthew,

Hmm... sometimes your graph is displaying all 0's.  We need to narrow this down a little further.  Is it a problem with the Graph, a problem with the DAQmx Read call itself, or a problem with the hardware setup.

Is there any way you can detect whether DAQmx Read ever returns all 0's in your code?  You could write some code that runs after you call Read but before you graph the data - in the code, loop through all the sample values and if they are all 0, flag this bad condition in your user interface. 

If you see the problem but you don't flag a bad DAQmx Read, this means there is something wrong with the way the values are getting displayed on the graph. 

If you can flag a bad DAQmx Read, this means there is something wrong with the hardware setup or the Read call itself.

Hope this helps,
Jonathan

 

0 Kudos
Message 3 of 10
(4,647 Views)
Hi guys, thanks for your replies.

Quoting from my original post...

I traced this back to the call to DAQmxReadBinaryI16. What is happening is that the data array that is returned is full of 0 values, the return value of the function is 0 (indicating no errors occured), and the number of samples returned according to the function is also 0.

Best Regards,
Matthew
0 Kudos
Message 4 of 10
(4,645 Views)

I am seeing a similar problem on my 6111 card.

To be exact, though, here is what I am doing:

I am setting up a reference trigger at a varible collection rate on a varible (1 or 2) number of channels. Before I run the reference trigger I run a good about a single reads to get basic data back from the device. All of these work fine. However, the aquisition never returns, and times out after 30 seconds.

The same software/hardware works fine on a 6115 and pci-meo-16c.

I also saw this when porting my product to .NET

0 Kudos
Message 5 of 10
(4,256 Views)
Hey Tyzack,

From my understanding, when you do a simple acquisition, everything works fine, but when you set up a reference trigger it is timing out. The acquisition is timing out because the device never receives the trigger. Is this an analog or digital reference and what is the source of the trigger? Does the trigger work if you set it up as a start trigger?
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 6 of 10
(4,203 Views)
What do you mean by simple acquisition? When I do a single read on the task, the data comes back fine. When I try to do an asyncronous collection, the trigger doesn't respond. Is it possible to using the Measurement and Automation program to "monitor" that channel to see if it is coming?

The source of the trigger is a digital flag coming in from our hardware. I am using a reference trigger not a start trigger because I need to the pre-scan ability, as such, a simple start trigger really won't work.

0 Kudos
Message 7 of 10
(4,189 Views)

[Edit] I tried changing to a start trigger and didn't get the flag that time either.

Also, I see this on 2 of the 6111s we have here, but not the other. Is there a way I can get a guid off the board and look for particular service annoucements about it?



Message Edited by Tyzack on 04-21-2008 03:34 PM
0 Kudos
Message 8 of 10
(4,186 Views)
Hello,
 
Can you me a little more clear ... are you using an analog or digital trigger?  When you stated that it worked, were you using a trigger and if so what type? 
 
It would be great if we could start from an example that ships with the DAQmx driver.  Please let me know if you are using examples and if so which ones. 
 
I am also curious to know if you used the same code and trigger with the 6115 that you stated worked.
Samantha
National Instruments
Applications Engineer
0 Kudos
Message 9 of 10
(4,156 Views)
Sorry about the double post ... I wanted to add more detail.
 
Hello,
 
Can you be a little more clear ... are you using an analog or digital trigger for the reference trigger?  When you stated it worked with a single read, I would assume you were not using a trigger.  Please clarify if it works without a trigger and if it has every worked with any type of trigger and what type.  It sounds like (so far) neither a reference trigger of start trigger is producing data from you with an Analog Input (AI)task.  Are you also using DAQmxReadBinaryI16  in the code?  It would be great to start with an example that downloads with the DAQmx driver.  Have you used the LabWindows/CVI example titled Acq-IntClk-DigRef.prj?  I realize that this example uses DAQmxReadAnalogF64 and not DAQmxReadBinaryI16, but it would be a good step to narrow down the issue.  Posting you code might also speed the troubleshooting process up. 
 
I am curious to know if you were using the same trigger source and code when the 6115 worked. 
 
I am also searching internally for you if there are any known issues with the 6110 with regard to triggering, so far I have not found any specific results.  How long have you had this device and to your knowledge did it ever working in this type of application.
 
 


Message Edited by samantham on 04-23-2008 11:16 AM
Samantha
National Instruments
Applications Engineer
0 Kudos
Message 10 of 10
(4,153 Views)