Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6009 Tutorial code fails

I attempted to walkthru the VB.NET code to add FFT data processing of the acquired data from a USB 6009 but get an error message for the following code line (after including the correct dimension statement; Dim analysisData as Double):
 
analysisData = Analysis.Math.ArrayOperation.CopyRow(data,0)
 
The error message is "Value of type '1-dimensional array of Double' cannot be converted to 'Double'."
I am running Visual Studio .NET 2003 and have Option Explicit On by default.  (Measurement Studio 8.0.11.181 beta)
Am I missing something?
 
As another issue, the USB 6009 works fine acquiring "N samples", but when I change the configuration to "continuous" in the DAQmxTask1.mxb project task and rebuild, it fails to acquire continuous data as a user control on the Form1.  Again am I missing something?
 
Thanks for the help
0 Kudos
Message 1 of 8
(4,470 Views)

This is from NI's tutorial titled: (hyperlink below)

Visual Basic .NET and USB DAQ Demonstration
Learn how to configure and program a complete USB data acquisition system that combines data acquisition, engineering analysis, and presentation.

Also, I got the continuous acquisition of the USB 6009 to work after "resetting" the DAQ using the Measurement and Automation Explorer "Reset Device" button.  Don't know why it would not work by just changing the acquisition mode from the DAQmxTask1.mxb to continuous and rebuilding from the development environment in Visual Basic .NET.

 

Dave

0 Kudos
Message 2 of 8
(4,460 Views)

Hey Star Sear,

You need to declare it as: Dim analysisData() as Double

You are trying to assign an array to a double instead of an array to an array.  Let me know how that turns out.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 8
(4,431 Views)

Thanks Sam,

Yes, your suggestion fixed the acquisition and spectral analysis.  New problem however. 

When working thru the tutorial to add the 2nd waveform graph to the DAQmxUserControl1 (after deleting the user control from the Form1), all seems well.  (Screenshot of the revised DAQmxUserControl1 attached as jpg image).

However, after building and added the revised user control to the Form1, the 2nd waveform graph appears "imbedded" in the frame of the original DAQmxUserControl.  (Screenshot attached)   I can't seem to decouple this arrangement, no matter how I try.

Perhaps it is a bug with the Visual Studio 8 beta?

Download All
0 Kudos
Message 4 of 8
(4,411 Views)

Hey Dave,

We really should start a new thread for this.  I have reproduced your issue with the non-beta version of MS 8.0.  I'm going to see if this really is a bug.  I will let you know when I find something out.  I did find how to decouple them.  Just move them far away from each other.  But then waveformGraph1 is really huge and goes off the control.

Message Edited by Sam R on 11-30-2005 04:21 PM

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 8
(4,392 Views)

Ok so there is an anchor property that is part of the graphs.  You need to set it to none and then you'll be able to not have the embedded graphs.  I hope that is helpful.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 6 of 8
(4,356 Views)
Ok at first it worked but now it's not working right.  I will have to delve into it a lot more.  I will post as soon as I come up with something.
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 8
(4,354 Views)

There is a method in the code for the user control called: DAQmxUserControl1_Resize If you comment that method out it should be normal.  I hope this is helpful.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 8 of 8
(4,324 Views)