04-23-2020 03:36 PM
Hello,
I am trying to convert continuosly 1d array of multiple floating point values into excel sheet. Created excel sheet (by WriteToMeasurementFile) include multiple values from each cycle of performed loop, however all data are in one column. I want to export these values in sucha way that at each cycle multiple values will be created in new row, and each row will have time stamp from cycle where current values where been created.
Thanks in advance for any help,
Borsuk
Solved! Go to Solution.
04-23-2020 09:01 PM
We cannot tell what you are doing wrong unless you show us your code. Please do. Thanks.
04-24-2020 04:08 AM
Wild guess: You need to activate Transpose array on your Write to measurement file.
04-27-2020 01:17 AM
In properties of Write to measurment file Express Vi I cannot find this option. Do I missed anything?
04-27-2020 01:31 AM - edited 04-27-2020 01:32 AM
Hi Borsuk,
@Borsuk wrote:
Do I missed anything?
Did you read message #2 carefully?
You have problems with your code, but you resist to show that code: how much help do you expect?
04-27-2020 05:46 AM
Hi GerdW,
I am sorry, somehow I didn't noticed this message. Please find in attachment code and example of excel file with results. I suppose that solution is very simple. I am a beginner so please do not judge me 😄
04-27-2020 06:52 AM - edited 04-27-2020 06:55 AM
How tied in are you to Excel? Do you really need an xlsx file or just something that can open in Excel? My recommendation would be to format your data into a tab delimited text file. You can open those very easily in Excel and it will format the way you want. I say to do this because it will make your code A LOT more performant and you can also view your data in a simple text editor (ex: Notepad).
But you also made a deadly sin of editing global code. Do NOT create projects in user.lib or edit the shipping driver. Make a new project that calls the VIs from the driver.
EDIT: I just noticed I missed the operation input on the Open/Create/Replace File should be set to "replace or create".
04-27-2020 07:34 AM
Sigh. Another inexperienced LabVIEW user misled by Express VIs and the really-confusing Dynamic Data Wire (which, in my opinion, should be banned).
The Excel File was most revealing. Did you notice that the "Time" values suggest that your data were sampled at 1 second intervals? That (as you asked!) the Time was reset to "Time = 0" for all but the very first set of 3 values (and I'm not sure why that has actual Timestamp data)? That you appear to be saving three values at a time (I'm assuming that you intend them to be columns, as in Channel 1, Channel 2, and Channel 3, but you don't provide enough detail about what you want to do for us to be sure), then three more, all in one column?
I'm guessing that each pass through the loop, you acquire 3 values. The logical thing to do would be to write those three values, as text, in a line, perhaps separated by a comma (or a tab). Such a (text) file could be read by Excel, which would recognize the separating comma or tab and make it an Excel table, even prompting you to save it as a true Excel (.xlsx) file.
If that's what you are doing,
Bob Schor