LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing time to milliseconds

Solved!
Go to solution

Hi svazquez,

 


@svazquez22 wrote:

I would like the data separated by columns and not rows.


So you want to transpose the data?

The same as is done with a Transpose2DArray function? Or with that "transpose" input on the WriteSpreadsheetFile function?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 11 of 15
(494 Views)

Hello again, thanks for all your help so far. Got a few more minor things I wanted to address. So after transposing my data, it is in the format I want but my time column appears last when I would like it to be the first one. Another question I have is if there is a way to label the columns in the spreadsheet. Another question is how could I get my waveform graph x-axis to display time in seconds instead of number of samples? One final question I have, as my program is now, I need to make a new spreadsheet file to write to manually to append the data to. I would like the program to automatically create a new spreadsheet without this manual step. Is there a way to do that? Once again, I appreciate all of your help!

Download All
0 Kudos
Message 12 of 15
(470 Views)

Hi svazquez,

 


@svazquez22 wrote:

So after transposing my data, it is in the format I want but my time column appears last when I would like it to be the first one.


Because you made the mistake of nearly all LabVIEW rookies: you use InsertIntoArray when you want to build an array! Use BuildArray to prepend your time row. (Or wire a 0 to the row input of InsertIntoArray - but the general rule should be "BuildArray to build an array, InsertIntoArray only when inserting in the middle of an array!")

 


@svazquez22 wrote:

Another question I have is if there is a way to label the columns in the spreadsheet.


So there should be a row of column headers above the rows of channel data?

Then write that row first to your file, then write the data/spreadsheet string to the file…

 


@svazquez22 wrote:

Another question is how could I get my waveform graph x-axis to display time in seconds instead of number of samples?


Set the X axis scaling (aka multiplier) to your sampling frequency using a property node of the graph…

 


@svazquez22 wrote:

One final question I have, as my program is now, I need to make a new spreadsheet file to write to manually to append the data to. I would like the program to automatically create a new spreadsheet without this manual step. Is there a way to do that?


Open the file using the OpenCreateReplaceFile function and use the mode "create or replace" (or "open or create" if this suits better).

Then write to that file. Use the file reference instead:

GerdW_0-1675800498101.png

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 13 of 15
(459 Views)

I am starting to get this error, I think it is because Labview is trying to do everything once.

 

Error -200281 occurred at MyVi.vi

 

Reading relative to the reference trigger or relative to the start of pretrigger samples position before the acquisition is complete.
Wait for the acquisition to complete before reading, or increase your read timeout. Also, make sure the hardware is set up and wired correctly, the signal for the reference trigger is correct, and that the reference trigger occurs while the device is acquiring data.

 

How could I make it so Labview waits until after the data has been collected to prompt the user for a data file?

0 Kudos
Message 14 of 15
(422 Views)

Hi svazquez,

 


@svazquez22 wrote:

I am starting to get this error, I think it is because Labview is trying to do everything once.

 

Error -200281 occurred at MyVi.vi


When you "think" what the reason might be then you should start with debugging!

This error clearly comes from DAQmx: did you even read the error explanation?

Your read timeout is to small to allow DAQmx read the requested samples AFTER receiving the trigger signal!

 


@svazquez22 wrote:

How could I make it so Labview waits until after the data has been collected to prompt the user for a data file?


By following "OBEY DATAFLOW!"…

The simplest solution would be to use error wires to define the dataflow/execution flow - you should have learned this by now from the Training resources at the top of the LabVIEW board!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 15
(419 Views)