Writing two arrays to a Excel Spreadsheet

Guru's
I am trying to take information from two arrays and write them to a spreadsheet. One array generates the headers information for the columns, the other array is a random number generator. The number of columns and rows are input from the front panel. The first column of the chart is time at some multiple (interval) input from the front panel
The problem I am having is timing the data out of the loop at the same time so they write together. One loop writes first and the other is left out. The data is going out to an excel spreadsheet. The data is correct for the headers and the columns, but won't write together.
I have only been using LabView for six weeks and have spent a good portion of this weekend working on this problem.
Attached are screen shots and the .vi of the problem. Explanations of each loop are writen in the block diagram.
Thank you for your time and help!!
Newbie2
Attachments:
writing to excel problem.doc ‏195 KB
Writing to excel problem.vi ‏27 KB

First let's talk about the code flaws:
Placing a text decoration over a path constant does not turn it into a valid path constant.
All your controls belong outside the loop, because it would be really bad if they could change during running of the loop. This is also less work, because LabVIEW does not need to re-inspect the control during each iteration.
Your while loop should be a FOR loop because the number of iteration can be calculated before the loop starts. This eliminates checking for termination.
You are not writing any excel files. You are just writing an ASCII table, but you possibly force excel to open it via a fake file extension. (this might be OK, but make sure to NEVER save it later as excel or the file structure would change dramatically).
"# of rows" and "# of machines" should be integers (blue).
Don't be afraid to brance a wire. You don't need any local variables if you do so.
To determine the order in which the segments are written to the file can be determined by dataflow if you wire it correctly. Wire the path to the write function that needs to write first. Then use the path output of this function and wire it to the next instance. Now the second instance must wait until the first one is finished.
(Currently you are branching the path wire, and the execution order is random!)
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Output 2 array elements onto excel spreadsheet

    Hello all, I am fairly new to LabVIEW and need some help.
    I'm trying to measure the output of a multimeter and send it on the the excel filesheet.
    The scenario is like this:
    I'm using 4 sequences
    The mutlimeter and power supply stated below are physical power supplies using VISA session
    1st Sequence
    Controls the power supply and adjust the voltage to 5 volts
    Obtain measurements from multimeter
    2nd Sequence
    Timer wait 500ms
    3rd Sequence
    Controls the power supply and adjust the voltage to 0 volts
    Obtain measurements from multimeter
    4th Sequence
    Timer wait 500ms
    All these sequence are wrapped around by a infinite while loop. And will stop looping once the stop button is pressed.
    What I want to achieve is to store the measurements of the multimeter when 5 volts and 0 volts is supplied and store it into a spreadsheet(the same spreadsheet with both measurements). These measurement will be stored continuously untill the stop button is pressed. So I can see a list of measurements.
    The problem I'm having now is that it only stores the last measurement and overwrites the old ones.
    Below is a copy of my VI. Please help me out here. Thank you
    Attachments:
    Working_Power_Supply.vi ‏44 KB

    Not having the subvi's on hand, i'm just guessing here.
    There's a coupla ways to accomplish this - here's an example using a shift register and a sequence local.
    2006 Ultimate LabVIEW G-eek.
    Attachments:
    Working_Power_Supply_2.vi ‏37 KB

  • Writing arrays in to excel

    Helo..
    I have sampled sine and cosine waves (4096 samples)  and the sampled values are in two different arrays. How can I write those arrays in to two different columns in excel sheet. I am using labview 8.2.
    post the appropriate vi. 
    Thanks in advance. 
    Solved!
    Go to Solution.

    Not to beat a dead horse, but this method will not work, or not work well, in some cases.  For example, you can't use the write to spreadsheet file function if you want to  write to a specific worksheet within a workbook.  Also, the "Write Table to XL" VI is extremely slow for writing large chunks of data - it's writing data cell by cell so that can eat up processor time as the spreadsheet grows. 
    A more efficient way is to use the "Value2" method of the ActiveX Range object.  This way you can write a huge set of data to Excel in a second or two.  I've attached a simple version of a VI I use as an example.
    Greg
    Certifed LabVIEW Developer
    Attachments:
    Write 2D array to Excel.vi ‏12 KB

  • Writing and Retrieving data from an Excel spreadsheet

    Hi all
    I am working on some battery chargers and need to record the data from my DAQ to an Excel Spreadsheet. How do i do that?
    I don't wanna purchase the Office toolkit from Labview!
    Please Help!
    RJ

    Hi smercurio_fc
    Hi Smercurio_fc,
    Thanks for the reply. I really appreciate your help.
    However, I would like to point out that after making numerous searches, I could not get any VI or thread working for my case. Most of the files complain regarding any of their missing sub-VI(s).
    I myself don't understand the problem. I have even re-installed the application to shoot any of the possible installation errors. I m not a spammer.
    I'll try to do what you have suggested in the former part of your reply.
    Regards,
    RJ

  • How to lookup a value in a 2D array from an Excel file - Dasylab version 12 Pro

    Hi, I am new to this forum and am looking for some advice on a worksheet I'm trying to construct.  I have an Excel spreadsheet that is basically a 2D array, and I want to use Dasylab v12 Pro to be able to import a value from this array based on user selections from within the Dasylab worksheet.
    Column A lists 200+ diesel engine models.  I've shown 9 in my Excel attachment...one model per row (shaded in yellow), and each engine model can be run at several speeds (shaded green in columns B thru F).  For an engine in a given row, combined with a chosen operating speed gives you a corresponding horsepower (blue shading).
    I have this Excel sheet saved somewhere on my C:/ drive, and what I want to do is when the user starts the Dasylab worksheet he will select from a drop drown menu to choose the engine model (ie A, B, C, etc) and another drop down menu to choose the speed (ie 1470, 1760, etc).  I know that I can make a drop down menu with a Coded Switch within Dasylab, however it seems only 16 choices can be made from each switch, so for my 200 engine models I will need 13 switches!  I know I can assign a text description like "Engine A" to a numerical value within that coded switch.  Somehow I need to take those two selections made within the Dasylab experiment, and read this Excel file (ie my database of all of these 200 diesel engine models) as a 2 dimensional array by row and column to spit out the data value (the blue numbers) back into Dasylab.
    The goal is to take the engine model, speed, and the horsepower obtained from the array search and write these to an .asc file that I will create a running log of this data.  So, after the test page is run 50 times it will have 50 rows of data containing these 3 parameters.  There is some other test data taken from my data acquisition that goes along with this, however that's not part of my 2D array predicament.
    I'm taking a guess that I need to do something with global strings & variables, and some how import them and export them with an ODBC in/out module.  This is something I've just never worked with before so I am a bit lost.  Obviously I can just make the user type in the engine model and speed as a startup parameter at the start of the test and save that to a variable or string, but I want to make it idiot proof so that the two selections (ie row and column) can be chosen from a pre-set list and will yield my data value.  Everything else related to Dasylab I am pretty proficient with.
    Thanks,
    Mike
    Attachments:
    engine 2D array.xlsx ‏10 KB

    This would be the best way.
    Also, with version 13 they started using Phyton to create custom modules that can be programmed in DASYLab.
    We arte learning this right now and I know that you can use standard message dialogs with that as well.
    I would suggest to you to download a demo of V13 and take a look at the Pyton module.
    Also, usually DASYLab system intgretors like us, can provide services also on things like this including Excel programming for pre and post analisys 
    Tom Rizzo
    InSyS Corp.
    www.insyscorp.com
    Your DASYLab integrator

  • Excel spreadsheets with macro's

    Good day
    Excel spreadsheets with macro's created in Windows does not work on my Macbook (excel for mac 2011), even if I enable macro's. I do not create these spreadsheets myself. Cn anyone assist please? Thank you for your time.

    Hi,
    As far as I known, the macro/Active X control can be used well with both of the Office 2013 and Office 365.
    Would you like to share us a sample file that created in Office 2013? I'd like to test it. You can send it via Email ([email protected]).
    If you have any update, please feel free let us know.
    ===========
    Update:
    I have received your mail and
    attachment. Then, I tested it, I found the probably reason.
    You were using ActiveX controls in the sample file, and them displayed 4 tabs in Format control dialog box. Next, you created a new Form control, it displayed 7 tabs.
    You were using the two type of controls. ActiveX controls and Form controls
    are different.
    Form controls
    Form controls are the original controls that are compatible with earlier versions of Excel, starting with Excel version 5.0. Form controls are also designed for use on XLM macro sheets.
    ActiveX controls
    ActiveX controls can be used on worksheet forms, with or without the use of VBA code, and on VBA UserForms. In general, use ActiveX controls when you need more flexible design requirements than those provided by Form controls. ActiveX controls have extensive
    properties that you can use to customize their appearance, behavior, fonts, and other characteristics.
    For more detail information, please refer to the following link:
    https://support.office.microsoft.com/en-us/article/Overview-of-forms-form-controls-and-ActiveX-controls-on-a-worksheet-d101804a-0f84-43ad-8cb2-e19277b8e3fb?CorrelationId=0e7129b7-8ea2-458c-af14-a99292d300b9&ui=en-US&rs=en-US&ad=US
    Hope it's helpful.
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • How to view excel spreadsheet in java

    Hello
    Is there a way to open an excel spreadsheet in java? I don't mean reading and writing from an excel file, but instead embedding excel in java. For example instead of launching excel using the Desktop class and opening a new excel window, Java would open an instance of excel and add it to Jframe or Jpanel. Sort of like what Eclipse does when you Open a file with In_Place Editor. Google returns results on how to use some windows dll file and using active x control or whatnot.. Was wondering if there is a better and simpler way..
    Thank you.

    oplead wrote:
    Hello
    Is there a way to open an excel spreadsheet in java? I don't mean reading and writing from an excel file, but instead embedding excel in java.Ah yes, "embed" is the word you want as your google keyword, not "open". My first try with "embed excel in Java" returned as the first link a page from a company named JIntegra for which this seems to be their main business. Here's the link I found, just for information:
    [http://j-integra.intrinsyc.com/support/kb/Article.aspx?id=30421|http://j-integra.intrinsyc.com/support/kb/Article.aspx?id=30421]

  • I need to move the data from several cells in an excel spreadsheet to another computer's excel spreadsheet.

    I have a data aquisition program on computer #1(not labview)  that writes to an excel spread sheet and I would like to have a row of data transfered to another excel spreadsheet running labview(computer #2)on the same network. I would like to make this transfer of data either over the network or some other method to link these two computers (they are two feet apart). I'm not sure that datasocket would help , as it seems that the data to be moved must be written for datasocket in labview.  My other alternative is to write drivers for the device that provides the data for computer #1. This is a new one for me as the user doesn't want to give up the non-labview program on #1.
    Solved!
    Go to Solution.
    Attachments:
    Read_Value_From_Excel.vi ‏83 KB

    I would write a LabVIEW VI to read the Excel file(s) on computer n°1 and publish the data in a shared variable over the network.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Can no longer open Excel spreadsheets attachments.

    I have recently upgraded to iOS 5 on my iphone4 and 3GS and can no longer open Excel spreadsheets attachments from my Hotmail. They come up as an E (which I think is Evernote). I don't want to use Evernote, I just want to view them as I could before. Even simple spreadsheets come as this annoying E when I try to open them. Everything worked fine before I did the iOS 5 upgrade and went with the cloud. I've no idea how to this happend or how to solve it.
    Can anyone please help?
    Regards
    Pickers120

    Generally if this happens the thing I have found to do is to quit the application and then restart the application by clicking on one of the files (like the ones in your documnets folder), not by starting the application and using the open command. Doing this immediately will usually solve the problem.
    This could also be an indication of some sort of file or disk corruption so I would recommend that you not only check the disk using Disk Utility from the CD but also checking your disk permissions just to be sure. Instructions for doing so can be found in steps one and two here: http://www.thexlab.com/faqs/repairprocess.html
    If the first two steps don't solve the problem then you might as well go to step three, otherwise stop with one and two.
    If you have backups and cannot get the files to open then your only other choice will be to restore from the backup copies. Either way I would make sure that my disk was healthy, by following the above noted steps, before doing the restore, otherwise you may corrupt the restored copy.
    Good Luck and let us know if this helps!!

  • How can I prepopulate a portion of a fillable form in Adobe Acrobat Profession XI from an excel spreadsheet?

    I have created a fillable form, and would like to prepopulate two fields from data in an excel spreadsheet.  Any ideas?

    You need to use JavaScript to import text data in a file setup using the tab delimiter and the column heading with the field name. You may need to select the row to import because one can only import 1 row of data.
    importTextData
    Has an example to import the first row. You can change the row number to see what happens.

  • Working with Excel spreadsheet embedded in access table

    Hello!
    I have Access DB which contain Excel spreadsheet objects embedded in table. To work with DB I use ADO-Tool based on ActiveX. Data passed to my program from GetRows method as 2D array of variants. As I understand I should convert variant to object refnum and then use this refnum with property and invoke nodes to get data from spreadsheet. How to select data type for VariantToData to work with Excel spreadseet?

    Hi,
    Isn't it the same that using Index Array function? I believe that problem is in conversion of variant to refnum. For example, if I change refnum data type to string in Variant To Data, no error appears, and I've got some text data (see the attachment).
    Attachments:
    Temp.zip ‏25 KB

  • Problem with embedded excel spreadsheet in Word document.

    I am having trouble with a word document that has an embedded excel spreadsheet in it.  If you double click on the spreadsheet to edit it, the following error message appears:
    "The program used to create this object is Excel.  That program is not installed on your computer.  To edit this object, you must install a program that can open the object."
    I know that Excel is installed on the PC.  The PC is running Windows XP SP3 x86 and Office Professional Plus 2007.  I have tried editing the spreadsheet on a PC running Windows 7
    Pro x64 with the same version of office and it works just fine.  I cannot find any differences in the setting between the two so I do not know why it works one place but not the other.
    Any ideas?

    If you double click on an Excel file in Windows Explorer, does Excel startup?  If not, right click on such a File and used the Open with item to set Excel as the default program for opening such files.
    If you need to do that, it may also overcome the issue with the embedded worksheet.
    Hope this helps.
    Doug Robbins - Word MVP,
    dkr[atsymbol]mvps[dot]org
    Posted via the Community Bridge
    "Flyguy009" wrote in message news:[email protected]...
    I am having trouble with a word document that has an embedded excel spreadsheet in it.  If you double click on the spreadsheet to edit it, the following error message appears:
    "The program used to create this object is Excel.  That program is not installed on your computer.  To edit this object, you must install a program that can open the object."
    I know that Excel is installed on the PC.  The PC is running Windows XP SP3 x86 and Office Professional Plus 2007.  I have tried editing the spreadsheet on a PC running Windows 7 Pro x64 with the same version of office and it works just fine. 
    I cannot find any differences in the setting between the two so I do not know why it works one place but not the other.
    Any ideas?
    Doug Robbins - Word MVP dkr[atsymbol]mvps[dot]org

  • Excel spreadsheet not printing correctly

    Recently bought a Envy 4500 all in one printer that my son installed. Everything works except for one thing on my excel spreadsheets.
    1. Every horizontal line is not printing, so I get larger boxes with two lines of print within.
    Thanks for your help....pjh
    This question was solved.
    View Solution.

    Probably more reading than you want to do (and not sure if you're using Excel 2010), but I found this:
    http://answers.microsoft.com/en-us/office/forum/office_2010-excel/in-excel-2010-cannot-get-gridlines...
    And maybe the Reader's Digest version of a solution?
    After much wailing and gnashing of teeth, and a small rain forest later this suggestion works:
    On existing Excel 2010 Spreadsheets
    In the Excel 2010 document, Print Preview and Print>Printer Properties>Advanced>Document Options>Print Optimizations: change setting to Disable. Save the file.
    Hopefully to work on new Excel 2010 Spreadsheets
    My computer>printers, or printers and devices>printer preferences, change 'Printer Optimization' from 'Enabled' to 'Disabled', then apply.
    Fingers crossed this will work on new spread sheets.

  • Troubleshooting issues opening Excel spreadsheets

    Platform: SP 2010 service pack 2. Office 2010, windows 7 on user laptop , IE 9 32 bit browser.
    several users started calling recently about problems opening Excel spreadsheets. They are on different SharePoint sites on the same site collection.
    No changes/patches have been made to SharePoint.
    No changes to the site collection features of configuration of which I am aware.
    The site collection is configured that users clicking on a doc library item opens in the application associated with the file type.
    When I, as a farm admin (which I need to do due to permissions), and I click on the Excel documents on person 1's troubled site, they open in Excel as expected.
    When the person reporting the problem clicks on the Excel spreadsheets, he gets one of two behaviors.
    On the first paginated page (documents 1-31) , if he clicks on an Excel document, two instances of the Excel application opens.
    On page 3 (documents 61-90) when he clicks on an Excel document, the excel data appears within the web page itself with a button at the top that says "Open in Excel". When he clicks that, he gets an error box that states
    To open this workbook, your computer must have a version of Microsoft Excel installed and your web browser must support opening files directly from Excel in the browser.
    This of course is interesting since on the first page, clicking on one of the documents uses the version of Excel installed and opens the file directly.
    None of these behavior, of course, can I duplicate.
    And, just to add another confusing item to the list, if this person goes to a different doc library and everything works fine.
    So this does not seem to be related to add-ons (why would add-ons act differently between sites?).
    The sites that I have examined all have the same advanced setting regarding opening the document in the client app rather than the browser.
    I have not yet started the process of having a repair on Office 2010 be broken in a way that on different pages different behaviors occur?

    Well, after the admins performed the repair on Office 2010, the user was able to click on Excel workbooks and have them open as expected.

  • Read from .txt file and output the content as two arrays

    I am using the contoured move to control the x-y stage. The trajectory datas for x and y axis are generated using my interpolation program and it is stored in a .txt file as two columns. What I want to do is read .txt file and output the content of this file as two arrays. Is there anyone has any ideas? Thanks, the .txt file is attached.
    Attachments:
    R.75.txt ‏172 KB

    Hi Awen,
    This is quite easy to do, you can merely use the "read from spreadsheet file" function to get a 2D array (2 columns and n rows) and then use the index array function to get whatever row/colums you want..
    Hope the attached VI helps you
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    read sprdsheet file.vi ‏27 KB

Maybe you are looking for

  • Where to find a VGA DE-15 to DVI-I connector/adapter ?

    Well, I receive my new Mac Pro (Apple Mac Pro Desktop 2.66GHz Intel Core 2 Quad) When I tried to hook up my Samsung SyncMaster 910T the connectors don't match. Mine has 15 pins (3 row of 5, with the middle one out of sync with the two others. I found

  • HP LASERJET 2200d - Optional TRAY 3 is grayed out in the print box - 10.2.8

    I just added the optional 3rd tray to the bottom of my LASERJET 2200d. I did a print test directly from the printer and it printed a copy from that tray without a problem. But when I try to print from an application, tray 3 cannot be selected in the

  • Connection iBook to DVI monitor, how to connect?

    Hey people! The question in subject. Just wanna add that if somebody experienced using Apple Mini-DVI to DVI Adapter? Thanks, Ivan iBook G4 1GHz 12 Combo   Mac OS X (10.3.9)  

  • TV Seasons Artwork Issue

    If I'm in the "Shows" view for a certain TV show, it shows the artwork on the right of the episode list, which is nice.  But if I click on Season 2, 3 etc, the artwork stays on the Season 1 artwork.  Anyone know if this will be fixed soon?  Thanks.

  • Display processes creates digital resonance sound

    Hopefully someone understands the problem: I´m using G4 MDD Dual 867 to make music and sounds. From the sound output there comes small electrical noise like beezzzziong or buzzzzing. It does not matter/disturb in everyday use as listening iTunes musi