Labview from Excel
Hi,
National Instruments gives an example how to transfer a XL range RxCx: RyCy
to a Labview array using DDE, but how to do that from several sheets in a
same Excel workbook ?
Could I have an example (or maybe using ActiveX ?)
Thanks
Patrick Ronsmans
[posted and mailed]
[email protected] (THALER CLAUDINE) wrote in
<8u1e6f$5o6$[email protected]>:
>Hi,
>
>National Instruments gives an example how to transfer a XL range RxCx:
>RyCy to a Labview array using DDE, but how to do that from several
>sheets in a same Excel workbook ?
>Could I have an example (or maybe using ActiveX ?)
>
>
Check out the "Developer Zone" on the NI website. There are plenty of
examples on how to use Active X to get at Excel. Be warned though it is not
for the faint-hearted. I also think that there are some examples in a file
called ole something or other .llb in the examples directory in your LV
distribution.
Alex.
Similar Messages
-
Calculate time difference in Labview from excel file
I am reading in values from a excel files, the file contains date and time data in one cell, then either an On or Off value in the cell next to it. I would like to find the time difference between the on and the off cycles. The VI I have so far brings in the Excel file but I don't know how to subtract the dates. Any help would be appreciated. I have attached the vi and hopefully I can attach and example excel file.
Attachments:
Hobo Import.vi 156 KBHi Bryan!
I made a small VI (in LabVIEW 7.1) that converts to strings (of your format) to timestamp datatype and then subtracts them resulting in a difference measured in seconds. There might be a more optimal way to do this in your application, but I thought I'd at least try to contribute. Also, notice that there is a Y3K bug in there :-)
Hope this helps!
Travis H.
National Instruments
Travis H.
LabVIEW R&D
National Instruments
Attachments:
FormattoTimeStamp.vi 38 KB -
How to call a labview dll from excel-VBA?
How to call a simple Labview DLL from Excel VBA?
I have seen examples of DLL calls from VB but does it work the same way for VBA? I have 2000 excel and Labview 8.5. I created the DLL and tried to call it from VBA using the same type of code as in NI's website example(ofcourse its a bit diff with 8.5)
http://zone.ni.com/devzone/cda/tut/p/id/...
BUT it errors out when called from excel
ERROR: The object invoked has disconnected from its clientYou would need to provide more details about the LabVIEW DLL, such as the prototypes of the functions (VIs) that you're trying to call, and your actual VBA code. Specifically, what object you're trying to create. You should also make sure the Run-Time Enginer is installed, as well as any required libraries such as the VISA Run-Time if you're using VISA. Have you made sure to enable the ActiveX server for the DLL?
A search yielded the following items that you may wish to peruse:
http://forums.ni.com/ni/board/message?board.id=170&message.id=261345&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=170&message.id=45099&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=170&message.id=299209&requireLogin=False
http://forums.ni.com/ni/board/message?board.id=170&message.id=195846&requireLogin=False -
Is it possible to export a histogram from labview to excel
is it possible to export a histogram from labview to excel,and of course get a fancy one
Hi achfire,
The LabVIEW Report Generation Toolkit allows you to create different graphs in Microsoft Excel, including Bar Graphs. Check out the Report Generation Toolkit section of the White Paper below for more information. I've also linked to a section of the Report Generation Toolkit Help document which gives more details on the different types of graphs you can export.
Moving Data From LabVIEW Into Excel: http://www.ni.com/newsletter/51339/en/
Common Graph Types for Reports: http://zone.ni.com/reference/en-XX/help/370274G-01/lvrgthelp/graph_types/
Thanks,
Myriam D.
Applications Engineer
National Instruments -
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 -
Hello,
I need some help. I have data in excel The first column is a timestamp and the other columns are the data needed.and I am trying to get a graph with multiple plots with these data.
attached here are the excel file and a labview file. In the labview file, the top part is an example I got from the forum, an interesting graph I am trying to follow.
The bottow part is my tentative to extract the data from excel into array and try to use it. but I am stuck here. Any help please!
Thank you,
Agyna
Attachments:
graph.vi 13 KB
Histo.xlsx 53 KBHi agyna,
I've saved xls file into csv and then i'm reading into labview and plotting the graph. Please check it this is what you need.
Thanks
uday,
Please Mark the solution as accepted if your problem is solved and help author by clicking on kudoes
Certified LabVIEW Associate Developer (CLAD) Using LV13
Attachments:
graph.vi 18 KB -
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 -
3D Pie chart from Excel to labview
Hi every one,
How can I Import a 3D pie chart from Excel to labview ?
ThxThere is no direct import mechanism for that. You would need to re-create the pie chart in LabVIEW, as LabVIEW has different 3D graphs than Excel. You would need to get the data out of Excel and use the 3D graphs to draw it. As for getting the data out of Excel, there have been numerous posts on reading data from Excel using ActiveX - just search for "read excel labview". You can also find many links to lots of other examples in the Excel thread. Please note: the Excel thread is a repository of links. Do not post a question in that thread.
-
How can I have a csv file read from excel to labview.
Hi,
I would like to read multiple csv files from excel to labview, creating a duplicate of the tables in excel, which would allow me to then draw some graphs for data analysis and comparison between the two.
Are there any examples that could be useful to what I am trying to do?
ThanksPatel33 wrote:
From one of the csv files, I only require 3 of the columns. Is there a way to only read that part of the csv file?
No. The characters in a file are just one long string and delimiters and linefeeds are special characters that defined where fields and lines start and end. As such, columns are interlaced into the file and consists of many small sections, where the position depends on the number of characters in each field, which is typically variable. You really need to read the entire file, then only look at the interesting columns later.
LabVIEW Champion . Do more with less code and in less time . -
Problem in reading data from Excel sheet to 2D string array (ActiveX & LabView).
I am trying to read data from Excel sheet to 2D string array (ActiveX & LabView). Error -2147352571 is generated (type mismatch) if cell value is "#NULL!", "#N/A" etc. What should I do?
Hello �
Is the error happening when the cell value is #NULL or #NA only?
Sometimes these errors occur because of an ActiveX object mismatch. The version of the ActiveX object might have changed or been updated since the VI was created. The VI tries to use an earlier, incompatible version of the ActiveX object.
To solve the problem, you need to link automation refnum terminal to the correct ActiveX object. To do so, right-click an automation refnum terminal and choose Select ActiveX Class»Browse from the shortcut menu. From the Type Library pull-down menu, select the latest version of the library you want to use, such as Microsoft Excel Object Library. In the Objects list, select an ActiveX object, and click the OK button. Link ea
ch automation refnum terminal in the VI and its subVIs until the run arrow is not broken. Also, you might have to replace some or all of the Invoke Nodes and Property Nodes for the ActiveX objects.
Also, I came across this Knowledgebase. The error number is slightly different but it is always good to check it out and make sure it is not your case.
Hope this helps.
S Vences
Applications Engineer
National Instruments -
Sending arrays from Excel into Labview
I want to send an array from Excel VBA into a LabView VI.
The Excel example shows how to send individual numbers and return an array into Excel but not send an array.
Everything tried sends blank arrays into LabView, which can then be modified in LabView and returned to Excel.
A VBA code snippit that does not work is:
Sub LoadData()
' LoadData Macro
' Keyboard Shortcut: Ctrl+l
' This is an example to demonstrate LabVIEW's Active-X server capabilities.
' Executing this macro loads a LabVIEW supplied example VI "Frequency Response.vi",
' runs it and plots the result on an Excel Chart.
Dim lvapp As LabVIEW.Application
Dim vi As LabVIEW.VirtualInstrument
Dim paramNames(0)
Dim paramVals As Variant
Set lvapp = CreateObject("LabVIEW.Application")
viPath = lvapp.ApplicationDirectory + "\examples\apps\freqresp.llb\DAK Frequency Response.vi"
Set vi = lvapp.GetVIReference(viPath) 'Load the vi into memory
vi.FPWinOpen = True 'Open front panel
paramNames(0) = "Foo"
paramVals = Sheet1.Range("j1:j1000").Value
Call vi.Call(paramNames, paramVals)
This code generates an error - expecting 1D array or variants.
However, if I supply the correct array, then LabView thinks it is empty
'foo' is a cluster
'Array' is a double array
Neither work to receive the dataThanks for the reply but that approach will be difficult. The problem to solve is relatively simple IF LabView could read arrays (it writes arrays easily). Here is the problem:
I want to convolute two large arrays. I have written VBA programs to do this but they take too long - over 30 sec whereas the LabView version take <1 sec IF I could get the data into LabView.
The convolute is part of an optimization program that goes though many loops so that it takes hours to run efficiently AND if I manually change cells in the spreadsheet, then it takes 30sec to come back as VBA does not respect clean cells (for some reason).
I was trying to write a function in VBA to do this calculation via LabView rather than VBA. One way to do this is to write a text file in VBA and read in LabView, then pass the results back or maybe the clipboard as a buffer. That is faster but clumsy. You could also have LabView look for dirty cells and then do the calculation as the server rather than the client. Again, time consuming and cumbersome. I have written pure LabView code to do the curve fitting but prefer to use Excel as that is easier to incorporate and work with the data. You can do convolute using FFTs but Excel does not do that correctly - they CANNOT make their FFTs into a function (VBA functions cannot modify cells in the spreadsheet but only return variables. FFT modifies cells so cannot be called from a function, only a macro, which then needs to be updated manually). Again, I can kluge VBA (real kluge this time) to make FFTs work as a function BUT prefer the LabView solution, if possible, as I am not sure the FFT will actually save time.
I am not sure if the problem is LabView's fault or Excel's (2013) fault that the variables are not set-up properly. LabView claims to be able to do this. Again, you can pass single variables into LabView and read back arrays but try as I might, I cannot get arrays into LabView.
Any help in sending arrays (maybe Labview expects a variant variable and needs to convert it somehow) would be appreciated. Variants are suppose to be able to be converted automatically but maybe there is a bug in LabView (2010) that does not handle input variant arrays correctly (I have tried making them clusters, double arrays, ect). LabView thinks that all the arrays sent by VBA are empty. If LabView modifies the same array, VBA sees that modification so that the addresses appear to be sent correctly i.e. the array "handle" is being sent to LabView or else it could not fill the array to send back to VBA.
If ever this is solved, I will put on-line the solution for others as again marrying both programs will have advantages. Others may find this interesting is marry LabView with Excel so that LabView does some of the heavy calculations that Excel has kluged. -
Running LabView run time from Excel
I need to run a labview runtime from Excel, the problem is I do not
have LabView installed on my computer so I do not see the LabView
object library in Excel VB interface, I assumed that installing a
runtime version should install that too.
Am i missing something, or is there a way to run a labview runtime VI
using ActiveX without actually intstalling labview.
Thank You.Hey Mike,
Two things to verify,
1. The LabVIEW run time engine is installed.
2. You've enabled ActiveX for your executable. See the picture below.
Chris C
Message Edited by Chris_C. on 02-22-2007 12:31 PM
Message Edited by Chris_C. on 02-22-2007 12:31 PM
Chris Cilino
National Instruments
LabVIEW Product Marketing Manager
Certified LabVIEW Architect
Attachments:
ActiveX.GIF 30 KB -
Multiple plots in one graph (LabVIEW to Excel)
Hi All-
Reference this initial discussion: https://forums.ni.com/t5/LabVIEW/Place-Multiple-Data-Sets-on-One-Graph-LabVIEW-to-Excel/td-p/2164380
Problem description: Generated multiple 2D arrays with different x-axis and y-axis values cannot be placed into ONE excel graph (looking for LabVIEW solution).
We tried several options. 1) Coercing the data to have the same x-axis works in the sense that I get a graph (of the multiple data sets) but the graph is bogus since the x-values are different enough that the graph isn't correct. (This was suggested in the referenced post). The x-values are output power and y-values are efficiency. 2) We can feed the x-values and y-values into a bundle element and wire the output into a waveform graph element which works great but again the output needs to be fed into excel. (also suggested by the reference post). 3) Lastly, we tried using the Excel Update Graph.vi but unfortunately we were only able to plot the last data set because it looks like the graph gets updated on each loop run and ultimately we only get the last data set. 4) As a final effort we tried looking into the sub.vi but that didn't get us any closer to x-values and y-values plotted in excel with LabVIEW generated data.
Any suggestions?
Thanks!Hi,
You attempted to invoke nodes? Add a invoke node of the waveform graph, so this add data to excel. There are several types of invoke nodes that can be used, such as invoke node "Export data to Excel" or the invoke node "Export data to excel Plot".
Regards
Hector
Attachments:
Export Data to excel from a waveform.vi 34 KB -
Giving a specific path to the reading from excel application
Hello, i want to know there is a way of giving a specific path to an application (reading from excel sheet) without all the time getting to enter the path? if someone could help. i'm using labview 8.0
Regards,
Tchaouyou could just use a path constant. Drop a path constant on the BD and right click on it and select browse and then find the file you want.
Joe.
"NOTHING IS EVER EASY" -
Labview Vs. Excel help in scaling
I currently have this excel page i created using labview.
and i am currently using microsoft excel page to scale it manually with the clicks of the mouse.
is there a way where I can automatically scaled it from labview to excel automatically?
please help
thanks
P.s- I am using labview 8.0 and used the activeX method to graph in excel
Message Edited by krispiekream on 11-14-2007 04:50 PM
Best regards,
Krispiekream
Attachments:
untitled1.PNG 23 KB
untitled11.PNG 25 KBI have an XY graph.
the properties of the graph already have x-axis & y-axis, min and max.
how do i use those properties and apply it to my excel graph?
can someone please help me. my on going problem with this case is giving me such hard times.
thank you!
Best regards,
Krispiekream
Attachments:
untitled2.PNG 30 KB
untitled1.PNG 29 KB
untitled11.PNG 37 KB
Maybe you are looking for
-
Help me choose a quality, studio vocal mic
Hi everyone - I'm still piecing together my home "mini" studio and am now ready to purchase a quality, studio vocal mic or two. I'd like to keep the budget at $500 or less, including used. Should I purchase two vocal mics for home studio recording? I
-
How to make sure Bridge Mode is OFF on my new TC
When I go into Airport Utility for my New TC, Network, Router Mode the choice is OFF(Bridge Mode). Does this mean the Bridge Mode is off?
-
Is Apple going to replace Scratched Nano's?
I like many others have just purchased an iPod Nano, and it already has scratches on it after only a few days. Obviously this is a production fault relating to inferior materials! Is Apple going to refund or replace Nano's suffering from this fault,
-
Dual monitors issues with Built application
I made a vi that uses both monitors. I set the run time position to the second monitor on one vi and the first monitor on the other vi. The vi running on the primary monitor calls the second vi on the second monitor vi the Vi Server. This works gr
-
BAPI BAPI_ADDRESSORG_SAVEREPLICA
Hi Friends, can we use FM BAPI BAPI_ADDRESSORG_SAVEREPLICA for Adderss details and also Mobile Tel no, FAX_NUMBER, Email Address . contact persons in vendor masetr update. pls help anyone to solve this issue. Regards, Sreenu.