From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Output File Formatting Question

Solved!
Go to solution

First off I will prefix this by saying that I am not a very good LabVIEW user.  Everything I have learned I just taught myself from looking at instrument control vi's.  Well I am trying to take a number of readings from my Agilient switch 34972A.  I can send the command, convert the return string, and make the reading into an array.  The issue I have is when I try to write that array to a file.  If I take the array directly as It comes out of the for loop that converts it from a string to an array, I end up with a file that looks something like this:

 

TimeData

025.8

124.3

226.1

323.9

025.7

124.4

225.9

324.1

 

And so on.  This is not at all what I want.  I understand what is happening but don't really know how to fix it except that way I did in my program below, but this is very tedious especially if I want to expand to 15 or 20 channels.  In this method I break the array appart recombine it and then write it to file and I end up with a file like:

 

TimeData0Data1Data2Data3

0.2525.824.326.123.9

0.525.724.425.924.1

 

And so on.  My question is that I am sure there is a simpler way to do exactly this but I can not seem to figure it out.  Any suggestions would be great thank you.

 

 

0 Kudos
Message 1 of 2
(2,015 Views)
Solution
Accepted by topic author kgould

Out of curiousity, what's wrong with just saving the instrument's response straight into at text file?  Seeing that it is comma delimited, I would save the data to a *.csv (command separated values file).  Then Excel will even read it nicely.

 

Something like this is what I'm envisioning.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 2
(2,011 Views)