09-29-2014 04:27 PM
I am evaluating XLR8 for purchase by our company, It looks promising but it would be a lot easer to use if I could append a 1d array directly to a row.
We do a lot of data collections here and the standard is a time stamp in column 1 and data in the next columns.
Most of our instruments return a datset in a 1d array, but there is really no way to write or append a 1d array to an Excel file in exlr8
The only way I can see to do what I want is to use a row counter and increment it each write.
Then index the array in a for loop and write each individual cell sequentially
Or use Get Last Row and increment
Then index the array in a for loop and write each individual cell sequentially
Both of theas methods are rather cumbersome and I would probably make a sub-vi to do this but it would be nice if you could roll them into one vi with a timestamp and 1d data input that would append it to the next row in the active sheet.
Maybe I am missing something, is there a better way?
09-30-2014 02:44 AM
Hi RTSLVU,
please have a look at the "Write Area" Functions. These take a 2D array as data input. When feeding 1D arrays (turned into 2D arrays) into them, they will write to colums or rows, respectively. Also, they are much faster for repeated write cycles than the "Write Cell" VIs. You might have to transpose an array before writing it, though.
The application you described is implemented in the example "exmpl_WR_Log_Time_and_Data.vi". Try the example finder: LabVIEW->Help->Find Examples, search for "XLR8". It should be the fourth example in the list.
Please let me know if you have any other questions.
Peter
09-30-2014 09:42 AM
I see what you mean and this does work better.
It would be nice to not have to use the Build Array function and even better to have these three vi's rolled into one "Append Line With Timestamp" vi which is what I will probably do myself
10-01-2014 01:58 AM
Hey RTSLVU,
I think I misunderstood your original post a bit. I see how such a function could be useful and we will discuss and evaluate internally if we will add such a VI to the API.
We see XLR8 as a flexible API focusing on the core functionality. In that sense, your VI that wraps the required functionality would be a good user example for the library! It would actually be great if you could share that VI as example code in the NI Community. We will be uploading some examples ourselves, soon.
Thanks
Peter