04-19-2013 01:36 PM - edited 04-19-2013 02:03 PM
Hello,
At my company we have Labview 2011 basic version with DAQmx. I am writing a program to get temperature data from thermocouples (16), dump it in an array and then store it in Excel using ActiveX. ActiveX seems only to allow writing element by element to my spreadsheet. When you do acquisition for a long period of time it can be very long! I like using ActiveX because it allows some flexibility such as choosing which sheet and cell I can write my data. Is there a solution to dump the array in one operation using ActiveX?
I know there is a block call write to spreadsheet which accept 1D and 2D array of data but doesn't allow the same flexibility. I also found report generation but is it made to write data? While waiting for your answer I'll try to dig a little more that blockset.
Thank you very much and I hope to hear from the community really soon.
Regards
04-19-2013 02:00 PM - edited 04-19-2013 02:01 PM
You can use the ActiveX _Worksheet Method in conjuction with the Range Property in order to write a 2D array of data to an Excel Worksheet.
04-19-2013 02:03 PM
04-19-2013 02:13 PM
It worked just fine... I don't know what I did wrong before. Many thanks!
04-19-2013 09:08 PM
Then please mark Electromecha's message as the solution to your problem rather than your own thank you message. First, you'll need to go to the options menu to the upper right of your message and pick Unmark as Solution.
04-23-2013 11:01 AM
I have to appologize. The solution given by Electromecha was good but only outside a loop. Again, I have 16 thermocouples and when I use Electromecha's solution inside a For loop it will copy only the first element. I attached two pictures. One is the program and the second is the result in the spreadsheet. You will notice that inside my loop I added an indicator to read the array before writing it in Excel. The indicator shows the array perfectly with all elements in it. The only way I found to work around this issue is to use indexing and write element by element in Excel. That is way too long!
For your information, the loop itteration is defined using the array size which is 16 (for 16 thermocouples). The subvi inside the loop allows me to get the column letter from the itteration number. Finally using the size of one full array of results I get the end cell row.
If more explanation is required please let me know.
Many thanks!