Measurement Studio for .NET Languages

キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

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 件の賞賛
メッセージ1/8
5,536件の閲覧回数

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 件の賞賛
メッセージ2/8
5,526件の閲覧回数

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 件の賞賛
メッセージ3/8
5,497件の閲覧回数

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?

すべてをダウンロード
0 件の賞賛
メッセージ4/8
5,477件の閲覧回数

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 件の賞賛
メッセージ5/8
5,458件の閲覧回数

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 件の賞賛
メッセージ6/8
5,422件の閲覧回数
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 件の賞賛
メッセージ7/8
5,420件の閲覧回数

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 件の賞賛
メッセージ8/8
5,390件の閲覧回数