LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save simultaneously collected data (two channels) with same file name but different extensions?

Hi everyone, 

 

Quick question.  I currently save two channels of an oscilloscope (collected simultaenosuly with the same x-axis) as a three column spreadsheet.  I was wondering how to set up the write to path such that Channel 1 has one file extension (call it .wav) and the data from channel 2 has a different file extension.  I've tried some different things but haven't had much luck.  Any suggestions are appreciated.  Thanks.

0 Kudos
Message 1 of 6
(3,927 Views)

Without seeing any code all I can say is you can name a file anything you want.

 

So saving two files with different names should not be a problem.

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 6
(3,918 Views)
Spoiler
 

Here is the code for anyone who would like a look.  I have included no sub-VIs or manufacturer VIs as they are not needed.  I out a flat frame around the section in question, which is in the second pane of the stacked sequence.  I built a 2D array from three 1D arrays and used the Write to Spreadsheet VI to write it into three columns.  My goal is instead of doing it this way, I would like to write the data into two separate files - same file name/location, but each with a different extension.  Thanks in advance for any help provided.  

0 Kudos
Message 3 of 6
(3,911 Views)

Ouch, that code made my head hurt... 

 

But in general you need to open TWO files and save your data (same or different) in whatever file you want.

 

Or you could simply save one file and use the LabVIEW file functions to copy it to a file with a different name.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 6
(3,906 Views)

It looks like you only write to the file once at the end, so it seems like you just want to separate the data points and write them to two different files at the end. Or if it's easier duplicate the one file.

 

Looking through your code, I noticed you're not creating your file correctly. You are addind a numeric on to the end of the filename so that it matches the Index of the loop. But you're adding the index at the end of the file extension, not the filename. So what you're getting is Filename.txt01 instead of Filename01.txt. Use this code to do what you really want:

index on filename.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 5 of 6
(3,884 Views)

Hi all, 

 

Thanks for the suggestions.  I was able to successfully figure out my issues, and they were much (much!) easier than I thought.  Sometimes, the stupid solution works best.  Thanks again.  

 

0 Kudos
Message 6 of 6
(3,832 Views)