Complicated graph on Excel using Labview

Hello All
1. I am trying to plot some complicated graphs from some csv data file. I have been able to do this in excel using chart wizard. However, I want to automate this process using Labview. I am stuck at trying to plot a excel graph with primary and secondary Y-axis.I am attaching the project file and the relevant Vi. I am also attaching a same excel sheet which shows the finished version of the graph. 
2. I am also having trouble with formating the graph to make it similar to that obtained from excel.Specifically
(a) How do I place the legends at the bottom of the screen
(b) Also, how do to turn values on X-axis by 90 degrees and also display all discrete values instead of every 3rd or every 4th data point.
Vi - MOS_FUT_Display1_Attempt4.vi
data file in csv format - MOS_Scores_Generic_Overall_27Oct09.csv
original excel along with reference output formatting - MOS_Scores_Generic_Overall_27Oct09.xls
It is notnecessary for me to use excel to get my output, if I can use any other functions or vi to get the desired results, I am Ok with it.
Thanks a lot for your help.
Venkat
Solved!
Go to Solution.
Attachments:
MOS_FUT_automation.zip ‏61 KB

Hi, i saw ur comments with an attachment,
I'm not sure if this is the way you need to get to your outcome, but here is one solution.
Attachments:
MOS_FUT_automation.zip 32 KB
and i was wondering do u still have it? and can you change it the 8.5? as im using labview 8.5
if not could you take screen shot from me.
Im quite interested in your program on how u create MOS_Scores_Generic_Overall_27Oct09.xls

Similar Messages

  • Xy graph in excel using activeX

    Hi
    I am trying to plot a XY graph in excel using Active X. I have two coloums of data one should be X the other should be Y. I am using XlXYscattersmooth graph type and giving the range as A1 to B5. But when the excel plots it, I am getting two series rather of X data points rather than XY. I know I am doing a simple mistake in choosing some variable but I am not able to figure out where I am going wrong.
    Can anybody please look at my code and correct the code in order to get a XY plot rather than getting two different series.
    Thanking you in advance
    Nitin
    Attachments:
    excel4.vi ‏155 KB

    Hello
    Here is that Set Cell Value with Range.vi
    Regards,
    Nitin
    Attachments:
    Set Cell Value with Range.vi ‏45 KB

  • How to read the data in spectrum analyzer (Anritsu MS2661C) and put it in Excel using Labview

    Hi all, I'm new to using the labview, and I have some trouble doing my project using the labview software.
    I have been trying to use the spectrum analyzer (Anritsu MS2661C) which connect to computer using the GPIB connection.
    I have got the instrument driver which can write and control the instrument using Labview 2010.
    and my Question is how do read the data or result from the spectrum analyzer and send it to the microsoft excel?
    Do I need to use other software or programming to do this step?
    If anyone know how is this done, please let me know.
    Regards,
    Ery

    Hi ery,
    In order to send data that you have read in from an instrument to Excel, the most convenient way to do this would be to use our Report Generation Toolkit.  The Report Generation Toolkit is a very useful tool that allows you to interface to Microsoft Office software from LabVIEW, including Word and Excel.  I am not sure if you are familiar with this, but I have attached a link that explains more about the Report Generation Toolkit below.  
    Another way would be to use the Write To Spreadsheet File VI.  While this will store your data to a spreadsheet data file, it will not allow you to programmatically perform any Excel formatting like the Report Generation Toolkit offers.  I have also attached a link to some information on the Write To Spreadsheet VI below.  
    Also, be sure to check out the Example Finder in LabVIEW for a number of examples on how to write data to a spreadsheet file.  From LabVIEW, you can go to Help»Find Examples to launch the Example Finder.  From there, you can search for "spreadsheet," which should populate examples for use in different applications.  I hope this helps, ery.  Please let me know if you have any further questions about these!
    NI LabVIEW Report Generation Toolkit for Microsoft Office
    Write To Spreadsheet File VI 
    Taylor G.
    Product Support Engineer
    National Instruments
    www.ni.com/support

  • How to change width of cell in Excel using LabVIEW 5.1

    Enable program to change width of cell in Excel 97 file using LabVIEW 5.1.

    You must have an automation reference to the workbook or the worksheet. Using Application Control pallette find the Property and Invode nodes and wire up the following, cascading the output of each node into the reference of the next:
    Start with worksheet reference
    Invoke Range
    Property Entirecolumn
    Property Columnwidth
    Change Columnwidth to write and wire in the numeric value in pixels.
    Michael
    [email protected]
    http://www.abcdefirm.com
    Michael Munroe, ABCDEF
    Certified LabVIEW Developer, MCP
    Find and fix bad VI Properties with Property Inspector

  • Populating graph in excel using ole

    Hi All,
    I am able to populate the graph from abap into excel using OLE.
    But I am not able to take x-axis and y-axis according to my requirement, its taking by its own as default. please see the below code:
    <b>CALL METHOD OF GS_EXCEL 'Cells' = GS_CELL1
        EXPORTING
        #1 = GV_LINE_CNTR
        #2 = 1.
        CALL METHOD OF GS_EXCEL 'Cells' = GS_CELL2
        EXPORTING
        #1 = GV_LINNO1
        #2 = GV_COLNO.
        CALL METHOD OF GS_EXCEL 'Range' = GS_CELLS
        EXPORTING
        #1 = GS_CELL1
        #2 = GS_CELL2.
        CALL METHOD OF GS_CELLS 'Select' .
        GET PROPERTY OF GS_APPLICATION 'Charts' = GS_CHARTS .
        CALL METHOD OF GS_CHARTS 'Add' = GS_CHART .
        CALL METHOD OF GS_CHART 'Activate' .
        SET PROPERTY OF GS_CHART 'ChartType' = '93' .</b>Now I want to give my own range. But i am not able to.
    I am also not able to give labels of x-axis and y-axis.
    Please help, its very urgent............

    Hello,
    try this code. It creates macro as a file, and than uses that macro to show the chart
    Regards,
    Naimesh
    REPORT ZTEST_NP .
    INCLUDE OLE2INCL. " OLE objects include
    *export data variables
    DATA: H_EXCEL TYPE OLE2_OBJECT, " Excel object
    WORKBOOKS TYPE OLE2_OBJECT, " list of workbooks
    THIS_WORKBOOK TYPE OLE2_OBJECT, " workbook
    CELL TYPE OLE2_OBJECT, " cell
    BOOK_FONT TYPE OLE2_OBJECT. " font
    *chart creation DATA: variables
    DATA: MODULE TYPE OLE2_OBJECT, "macro
         NEWMODULE TYPE OLE2_OBJECT. "macrotab with VB source code
    INternal tableTABLES: no_table.
    DATA H TYPE I.
    table that contains Visual Basic source code
    DATA: BEGIN OF MACROFILE OCCURS 0,
          LINE(80) ,
         END OF MACROFILE.
    *Internal table with Months and related Profits
    DATA: BEGIN OF NO_TABLE OCCURS 10,   "Internal table with no's
          MONTH(8) TYPE C,
          PROFIT(8) TYPE C,
         END OF NO_TABLE.
    *Months added to table as well as Profits
    NO_TABLE-MONTH = 'June'.
    NO_TABLE-PROFIT = '1000'. APPEND NO_TABLE. "Update table
    NO_TABLE-MONTH = 'July'.
    NO_TABLE-PROFIT = '4000'. APPEND NO_TABLE. "Update table
    NO_TABLE-MONTH = 'August'.
    NO_TABLE-PROFIT = '3000'. APPEND NO_TABLE. "Update table
    NO_TABLE-MONTH = 'September'.
    NO_TABLE-PROFIT = '7000'. APPEND NO_TABLE. "Update table
    NO_TABLE-MONTH = 'October'.
    NO_TABLE-PROFIT = '7000'. APPEND NO_TABLE. "Update table
    NO_TABLE-MONTH = 'November'.
    NO_TABLE-PROFIT = '6000'. APPEND NO_TABLE. "Update table
    CALL METHOD OF THIS_WORKBOOK 'InsertFile'
    EXPORTING #1 = 'C:\VBsource.tmp'.
    *********Fill makro table with VB source code************************
    the macro's name is draw_graph
    MACROFILE-LINE = 'sub draw_graph()'. APPEND MACROFILE.
    MACROFILE-LINE = 'Range("a1:a1").Font.Bold = True'.APPEND macrofile.
    MACROFILE-LINE =
    'Range("a1:a1").Value = "Net Profits for last few months.
    "'. APPEND macrofile. "Bold heading at top of sheet.
    MACROFILE-LINE = 'Range("A2:B7").Select'. APPEND macrofile.
    MACROFILE-LINE = 'charts.add'. APPEND MACROFILE.
    MACROFILE-LINE = 'activechart.charttype = xllinemarkersStacked
    '. APPEND macrofile.
    MACROFILE-LINE =
    'Activechart.setsourcedata source:=sheets("Sheet1").range("A2:B7") ,
    PLOTBY:= XLROWS'. APPEND macrofile.
    MACROFILE-LINE = 'activechart.location where:=xllocationasobject, name:=
    "sheet1"'.  APPEND macrofile.
    MACROFILE-LINE = 'With ActiveChart'. APPEND MACROFILE.
    MACROFILE-LINE = '.hasLegend = false '. APPEND MACROFILE.
    MACROFILE-LINE = ' .Axes(xlValue, xlPrimary).HasTitle = True'.
    APPEND MACROFILE.
    MACROFILE-LINE = '.axes(xlvalue, xlprimary).axistitle.characters.text =
    "Net Profit ($)"'.
    APPEND MACROFILE.
    MACROFILE-LINE = 'End With'. APPEND MACROFILE.
    MACROFILE-LINE = 'msgbox ("Chart completed!")'. APPEND macrofile.
    MACROFILE-LINE = 'end sub                         '. APPEND MACROFILE.
    *******************vb source code end********************************
    ***********create file with visual basic source code *******************
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
    FILENAME = 'c:\VBsource.tmp'    "directory with temporary file
    FILETYPE = 'ASC'
    TABLES
    DATA_TAB = MACROFILE
    EXCEPTIONS
    FILE_OPEN_ERROR = 1
    FILE_WRITE_ERROR = 2
    INVALID_FILESIZE = 3
    INVALID_TABLE_WIDTH = 4
    INVALID_TYPE = 5
    NO_BATCH = 6
    UNKNOWN_ERROR = 7
    OTHERS = 8.
    **********create file with visual basic source code end**************
    **write info to screen (ABAP)
    LOOP AT NO_TABLE.
    WRITE: / SY-VLINE NO-GAP,
    NO_TABLE-MONTH COLOR COL_KEY NO-GAP, SY-VLINE NO-GAP,
    NO_TABLE-PROFIT COLOR COL_NORMAL NO-GAP, SY-VLINE NO-GAP.
    ENDLOOP.
    ULINE (61).
    **********************START THE EXCEL APPLICATION*********************
    CREATE OBJECT H_EXCEL 'EXCEL.APPLICATION'. "type of application
    PERFORM CHECK_ERRORS.
    SET PROPERTY OF H_EXCEL 'Visible' = 1.
    PERFORM CHECK_ERRORS.
    CALL METHOD OF H_EXCEL 'Workbooks' = WORKBOOKS.
    PERFORM CHECK_ERRORS.
    create a new workbook
    CALL METHOD OF WORKBOOKS 'Add' = THIS_WORKBOOK.
    PERFORM CHECK_ERRORS.
    ***********fill the Excel table with data*****************************
    PERFORM FILL_EXC_TAB USING 1 1 1 'Profits:'(001). "initial heading
    LOOP AT NO_TABLE.
    H = SY-TABIX + 1.
    PERFORM FILL_EXC_TAB USING H 1 0 NO_TABLE-MONTH.
    ENDLOOP.
    LOOP AT NO_TABLE.
    H = SY-TABIX + 1.
    PERFORM FILL_EXC_TAB USING H 2 0 NO_TABLE-PROFIT.
    ENDLOOP.
    ***********fill the Excel table with data end*************************
    ************DRAW the CHART using the values exported *******************
      CALL METHOD OF H_EXCEL 'Modules' = MODULE.
      PERFORM CHECK_ERRORS.
       CALL METHOD OF MODULE 'Add' = NEWMODULE. " the macro
       PERFORM CHECK_ERRORS.
        CALL METHOD OF NEWMODULE 'Activate'.
        PERFORM CHECK_ERRORS.
    get source code from temporary file
    CALL METHOD OF NEWMODULE 'InsertFile' EXPORTING #1 = 'C:\VBsource.tmp'.
    PERFORM CHECK_ERRORS.
    executing VBA program code -> macro name = "draw_graph"
    CALL METHOD OF H_EXCEL 'Run' EXPORTING #1 = 'draw_graph'.
    PERFORM CHECK_ERRORS.
    FREE OBJECT H_EXCEL. "free up memory
    PERFORM CHECK_ERRORS.
    FORM FILL_EXC_TAB USING I J BOLD VAL.
    CALL METHOD OF H_EXCEL 'Cells' = CELL EXPORTING #1 = I #2 = J.
    PERFORM CHECK_ERRORS.
    SET PROPERTY OF CELL 'Value' = VAL .
    PERFORM CHECK_ERRORS.
    GET PROPERTY OF CELL 'Font' = BOOK_FONT.
    PERFORM CHECK_ERRORS.
    SET PROPERTY OF BOOK_FONT 'Bold' = BOLD .
    PERFORM CHECK_ERRORS.
    ENDFORM.
    error handling subroutine
    FORM CHECK_ERRORS.
    IF SY-SUBRC NE 0.
    WRITE: / 'OLE error:'(010), SY-SUBRC.
    STOP.
    ENDIF.
    ENDFORM.

  • How to add two series data in singal xy graphs in excel through labview

    Hi,
    I am trying to generate excel report and needs to plot XY graph in excel sheet. Using excel insert graph VI I am able to pass the data to excel and generate the XY graph (one x axis and many y axis), but I am not able to add a series in the graph that means not able to plot two XY plot in same graph (for example two plot X1Y1 and X2Y2 on same Graph). I know the other options like passing the image of graph control to excel sheet and by passing the data to specified cells and generating the xy plot.But my requirement is plotting xy plots in singal xy graph without displaying the data in tabular form in excel sheet. (Like when we call the insert graph VI, it will only inserts the OLE object and data is hidden in that)  Please let me know if you need more clarification and let me know how to do this..
    Regards
    Santosh

    I have got answer from another post. Thanks.

  • How to copy the XY graph on labview front panel and insert into Excel using labview

    Hi all,
    The XY graph display on LV front panel after test. How can I copy this XY graph and insert into excel file?
    Thank you very much for your help.
    Khanh

    KPRO wrote:
    Hi,
    I refer to insert it into excel since report is in excel format, but if it's too hard to do so I can save it in another format.
    Either way, will labview support this? Anyway, thank you very much for your quick reply.
    Khanh
    You are already using the Report Generation Toolkit?  There is the "Append Control Image to Report.vi" that would make this easy.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to randomly select data from excel using labview.

    A very good day to all. I am actually working on a system that will be selecting integer number from randomly generated set of number. If that wouldnt be possible, I would like the system to be able to select number from the set of numbers which have already been randomly generated from excel. kindly help me with the solution. To make myself clear, supposing I have set of numbers from 1 to 10, I want a labview setup that will be picking these numbers one after the other either with replacement or without from excel or self generated. I know this is possible in matlab but would prefer labview if possible.  Thanks
    Solved!
    Go to Solution.

    Most, if not all, of the languages I've run across have a rand() function that returns a random number between 0 and 1.  Getting some other range is up to the programmer.  Usual method is to multiply by the range you need and add an offset to adjust the mean.  For instance if you need a random number between 200 and 300 the formula might look like  " rand()*100+200 ".   If you need an integer, you can use the round function (which will leave it as a float with no decimal pportion) or the conversion (to int).    All of this is doable and straightforward in LabVIEW.  Have a look: http://digital.ni.com/public.nsf/allkb/FCCDCD678EEF3A9186256D7B008054F5
    If you feel more comfortable pulling from a file, try this: http://digital.ni.com/public.nsf/allkb/C944B961B59516208625755A005955F2 

  • How to write output from Keithley 220 to Excel using Labview

    Hello, I have seen other posts that ask this question and was wondering if anyone has found the solution? I have downloaded the driver and seem to be able to communicate with the instrument. However, I am not very sure how to modify the driver to set the amperage and record the output to Excel.

    Hi rachel-d,
    It looks like that instrument driver is only one VI, and is not a certified driver.  There seems to be a control for "source (A)" which may be what you're looking for as far as setting the amperage.  Honestly, you may have better luck starting with a simple GPIB communication program and writing your own VI.  You may need to check your device's manual for information on specific commands to set current values, etc.  As for excel, you could use the Write to Measurement File Express VI and write your data to a text-based measurement file (.lvm) that is tab deliminated.  You can then open this file with Excel.  There are also examples you could look at in the NI Example Finder (Help > Find Examples).
    Hope this helps!
    Adam W
    Applications Engineering
    National Instruments

  • How can I change the names of the Excel Worksheets using LabView?

    Hi Everyone...
    I want to start a project but I want to be capable to create and change the names of the worksheets in excel using LabView.
    We know the default name of the worksheets (Sheet 1, Sheet 2...)
    Can I make this change only using labview with some activeX, properties and methods...
    Best regards...
    Mexico
    LabView 8.0

    Hello,
    Yes, you can modify the name of an Excel Sheet with ActiveX property Node or Invoke Node.
    There are some good examples in the NI Example Finder of Labview on "Communicating with external Applications -> ActiveX -> Excel ->..."
    To modify the name of a sheet, you need to use the property "Name" of the reference "Sheet"
    Best regards
    Nick_CH

  • Add multiple graphs in one chart(ex.scatter chart) using labview excel report generation toolkit

    How to add multiple graphs in one chart(ex.scatter chart) using labview excel report generation toolkit. Assume like my test data is like below:
    X-Axis
    Data1
    Data2
    1
    1
    2
    13
    2
    3
    14
    3
    4
    15
    5
    5
    16
    3
    6
    7
    7
    The above graph generated manually in excel. I want to generate the same using excel report generation toolkit. when I use Excel Insert Graph.vi where the input data is 2D array with numeric data but here labview converts the empty cells (eg.x -axis 1,data1- is empty) as zero and while plotting i am getting zero for empty cell values.
    Can anyone please help me on how to plot the graph without adding zero for empty cells?
    Thanks&Regards,
    Bharathi T
    TE
    X-Axis
    Data1
    Data2
    1
    1
    2
    13
    2
    3
    14
    3
    4
    15
    5
    5
    16
    3
    6
    7
    7

    Hi Bharathi,
    The Excel Insert graph function takes in only 2d arrays as inputs. Since arrays can only have numeric values, any table with a null string is read as 0. Now to get a plot like you mentioned, you could read the table and replace blank Strings as NaN. NaN values in an array when plotted do not appear in the excel sheet. For reference I have attached a sample vi to help you understand.
    Regards
    Vijetha Nuthakki,
    Applications Engineer
    NI Systems India
    Attachments:
    Excel_graph_multiplot.vi ‏21 KB

  • How to let the user define the colors for each plots in the graph (I use LabVIEW 7)?

    How to let the user define the colors for each plots in the graph (I
    use LabVIEW 7)?

    Hi,
    Take a look at this example, it uses property nodes to select tha
    active plot and then changes the color of that plot.
    If you want to make the number of plots dynamic you could use a for
    loop and an array of color boxes.
    I hope this helps.
    Regards,
    Juan Carlos
    N.I.
    Attachments:
    Changing_plot_color.vi ‏38 KB

  • How to read and write data from Excel to TestStand without using LabVIEW VIs

    Hi,
    How can I read in columns of data from Excel into a TestStand array and write columns of data to Excel from TestStand without using LabVIEW VIs?
    I don't think the Property Loader custom step type in TestStand will work because the data I would like to read in from Excel is in a column that is thousands of rows long and the data has to be in the proper format to use the Property Loader to load in an array from Excel.
    Thanks for your help.

    That example does not use LabVIEW and it does about 40% of what you need to do by calling Excel through ActiveX. If you don't know how to use Excel through ActiveX then you'll need to brush up on that.
    http://www.microsoft.com/en-us/download/details.aspx?id=16250
    http://support.microsoft.com/kb/141759
    http://support.microsoft.com/kb/302084
    CTA, CLA, MTFBWY

  • Error -2146960888 when opening excel from labview using active x

    attempting to open an instance of excel from labview using active x, I even tried using the "open excel and make visible.vi" found on this site. I get errors every time, Inserting a break right after the property node, I found that it does open excel with no active workbook. once the program runs to ompletion excel terminates. The error is on the line right after the property node executes.

    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3F15456A4E034080020E74861&p_node=DZ53003&p_submitted=N&p_rank=&p_answer=&p_source=External
    Attachments:
    XL97table.zip ‏29 KB

  • How to use Labview to Send Commands to Excel on Analyzing Data

    Hello, here is my situation:
    I have a Labview VI that reads in data from various sensors and uses the Report Generation Toolkit to send all the data values to Excel. Since every run is ~ 8-10 hrs long and there's tons of data, I don't bother to store them all in an array in my VI. 
    However, within my Excel report I'd like to include a few stats, such as initial, final, max, and min values from all those data points. What kind of command should I send from my VI to get Excel to do this? Or would it be easier to do this within Labview instead?
    Thanks to anyone who can give some advice!
    Solved!
    Go to Solution.

    Hello, Kalyie!
    puneet.kapoor is indeed correct, you can create an Excel macro and call it from LabVIEW. An example of this can be found in LabVIEW under Help>>Find Examples. By searching for "Excel," you'll find "Excel Macro Example." This would be more useful for automating your functions, or if you're trying to do more complex operations on your data in Excel (min and max are relativelty simple, though).
    As also mentioned, it may be easiest to work with your data once it's in excel, using the "=Max( )" and "=Min( )" functions - the choice is yours!
    Will Hilzinger | Switch Product Support Engineer | National Instruments

Maybe you are looking for

  • Can't play Movie Trailers from iTunes Store!

    I am wondering if anyone knows why I cant watch free movie trailers on the iTunes Store? It follows as far as letting me choose the size of the trailer cilp I want to watch but after that nothing loads up! the top half of the page is blank! Also I ca

  • Lightroom 4 slow download?

    Anybody notice that their download of Lightroom 4 is incredibly slow? I'm getting about 38 *K*B/s on my ~50 MB/s connection. Speedtest seems fine, other downloads are fine too.

  • OS X 10.5 Leopard preview crashes with LR pics

    I just found out that some pics can cause the preview application in Leopard to crash! It is not clear in the moment whether to blame Apple or Adobe because the error only occurs with pics touched in LR1.2 but the same pics work well with other appli

  • Sqldeveloper /as sysdba connection

    I'm a total newbie in Oracle. I installed Oracle 11g XE R2. Also I installed SqlDeveloper 3.2.20.09 version. I have Java Version 7 Update 25 I generated auto connections, and I have 2 connections. One is: /as sysdba and another: system-XE I successfu

  • Microsoft Messenger or Ebuddy connects and disconnects

    Hello I've just bought my iPhone 4 a month ago. I'm very happy with it (formerly a BlackBerry user) but there's an issue that is driving me crazy. I've installed Microsoft Messenger and it connects and disconnects every 3 minutes. Also I've tried wit