Locked visual basic link with national instrument

  • יום שישי 11 מאי 2012 05:24
     
     

    hi,

    i am new to VB2010. Right now, I am trying to make the CWGraph control (National Instruments) to plot a graph by loading data from database Access. Can anyone help me? Is that possible? I want it to plot graph offline before doing online using NI-DAQ.

כל התגובות

  • יום שישי 11 מאי 2012 17:59
     
     תשובה

    Yes, you can do this.  Just load an array from the database with the numbers that you want to display.  Then use the .PlotYAppend(array) or PlotYAppend(ItemFromArray) in a loop.  You can plot any numeric value this way, though the control normally expects a numeric Double.  Also look at the PlotWaveform. PlotX and other methods that may apply.

    You also might want to look at the Visual Studio built-in Chart control, which may do all that you need.

    Dick


    Dick Grier. Author of Visual Basic Programmer's Guide to Serial Communications 4. See www.hardandsoftware.net.

  • יום שני 14 מאי 2012 09:06
     
     

    Thanks for your reply.

    If possible, can you show me an example coding vb for this? because I don't quite familiar with vb programming. I already load the data from database.

  • יום רביעי 16 מאי 2012 18:18
     
     

    The code is as simle as

    control.PlotY(Buffer)

    where control is the name of the NI waveform graph control, and Buffer is an array that you have populated from your database.  Of course, you will have set the appropriate waveform graph properties to select the type of graph that you want to display, and other properties that may be required.

    Take a look at this example: http://zone.ni.com/devzone/cda/epd/p/id/1687

    Dick


    Dick Grier. Author of Visual Basic Programmer's Guide to Serial Communications 4. See www.hardandsoftware.net.

  • יום רביעי 13 יוני 2012 03:19
     
     

    The link you gave results empty file.

    I need to plot contour graph for three parameters which are magnitude,time, and frequency in vb 2010. By using Matlab, we can plot the contour graph by simply insert contour(x,y,z). Any idea on how to plot the contour in vb2010?

  • יום רביעי 13 יוני 2012 16:13
     
     

    You may not be able to duplicate it exactly, but take a look at this: http://msdn.microsoft.com/en-us/library/dd489232 (the .NET built-in Chart control), and http://zone.ni.com/devzone/cda/epd/p/id/1641.  To use the NI plotting solution, you must build x86, not AnyCPU (or x64).

    Dick


    Dick Grier. Author of Visual Basic Programmer's Guide to Serial Communications 4. See www.hardandsoftware.net.

  • יום חמישי 19 יולי 2012 03:40
     
     

    anyone know how to plot contour using 3d graph in VB like below that made out using matlab??

  • יום חמישי 02 אוגוסט 2012 07:26
     
     
    i got it ;)