LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compile Data in Spreadsheet

Hey everyone,

I need to compile the data from my vi into a spreadsheet. I know that I need to include the write to spreadsheet file express and include it in the loop, but I am not 100% sure how to wire it so that all of the data is included and appended to the new file.  Any help would be much appreciated.

0 Kudos
Message 1 of 4
(2,549 Views)

Hi jisoccer,

 


@jisoccer wrote:

I need to compile the data from my vi into a spreadsheet. I know that I need to include the write to spreadsheet file express…


You don't want to "compile data", you want to save data to a file.

Why do you know you have to use an ExpressVI? Ever thought about using no ExpressVIs?

 


@jisoccer wrote:

I am not 100% sure how to wire it so that all of the data is included and appended to the new file.  Any help would be much appreciated.


Which data should be included when saving to file?

Is there an expected format for your spreadsheet file?

Do you need just that scalar "Motion detected" boolean value? (Which formatting should be applied to the boolean value?)

Do you also need the simulated sine wave? Do you need to save just the sine parameters (amplitude, frequency), or the waveform, or even twice the waveform as you use that sine for two signals?

 

What have you tried so far? Where are you stuck? Did you get any errors?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,498 Views)

Hi,

This is what I have done so far.  I need to log each intrusion time to a file.  Am I on the right path for this?

0 Kudos
Message 3 of 4
(2,463 Views)

Hi Ryan,

 


@jisoccer wrote:

I need to log each intrusion time to a file.  Am I on the right path for this?


Not yet…

 

Right now you are logging some data with each iteration of your loop. But when you need to log ONLY in case if "intrusion" you will need some case structure around the file write operation!

You are trying to access the same file twice in parallel: this will either fail with errors or one file write operation will overwrite the text of the other operation! (Especially when one operation is set to "append" mode, while the other is set to "replace or create"…)

You also forgot the error handling for those file operations…

I don't see any place where you try to even get some "intrusion time" value, all I see in your VI is a simulated sine wave…

NEVER hide labels in the block diagram!

Your sine wave consists of 44100 samples, but you want to write those samples into the same file as a scalar timestamp of some "intrusion event"? This is a big mismatch of sample counts…

Why do you merge the sinewave DDT wire into a DDT of 2 signals, just to convert that DDT of 2 signals into a 1D array of samples? What is the expected result of converting a DDT, holding 2×44100 samples, into a 1D-array? (General hint: stay away from ExpressVIs and their DDT wires!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,460 Views)