LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to spreadsheet without prompting each time through a loop

Solved!
Go to solution

@Dennis Knutson wrote:

NO,NO,NO.

 

Just wire the 2D numeric array to the Write to Spreadsheet File. The Array to Spreadsheet String would be used only if you used a low level write file function instead of the Write To Spreadsheet. Turn on Context Help and read it when you hover over the Write to Spreadsheet. Read about the format string.


The original was done like that that I attached here. The problem is the current is so small that when it is put into the spreadsheet it is returning zero instead of the exponential. I think you were not fully aware of what i am attempting to do. Ravensfan suggested the array to spreadsheet with the formatings. Am I correct you were just confused or am I just misunderstanding?

0 Kudos
Message 21 of 34
(1,436 Views)

I suggested doing the formatting before writing anything out is because (unless I'm mistaken), the Write to Spreadsheet File only accepts one format specifier that applies for all of the data.  My understanding of the original poster's requirements is that one of the columns of data is very small and thus needs its only special format.

0 Kudos
Message 22 of 34
(1,432 Views)

@Ravens Fan wrote:

I suggested doing the formatting before writing anything out is because (unless I'm mistaken), the Write to Spreadsheet File only accepts one format specifier that applies for all of the data.  My understanding of the original poster's requirements is that one of the columns of data is very small and thus needs its only special format.


I would say that is correct. I dont need the timestamp to have a lot of digits just need my amps that are very small not to read as 0. I got confused with where to turn the data in a string array and how the string write to spreadsheet would work. That is why I attached a rough copy of that attempt two posts prior. It seemed to me I was either trying in the wrong spot or the wirings of it didnt seem to match what was already in the loop.

0 Kudos
Message 23 of 34
(1,430 Views)

I would stick with the array to spreadsheet vi and use %s as the format string.

 

I have found that this formats every thing to an exact string of what ever you put into it.

 

Once it is in Excel you can adjust the amount of decimal places visible by formatting cells.

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 24 of 34
(1,420 Views)

RTSLVU wrote:

I have found that this formats every thing to an exact string of what ever you put into it.


Except for integers, a decimal formatted string is almost never "exact".

0 Kudos
Message 25 of 34
(1,414 Views)

I am still getting stuck. What is supposed to come out of the spreadsheet string? If I make a control how is that to be used? I still want to be prompted once for a file then append each time through the loop without prompting thereafter.

0 Kudos
Message 26 of 34
(1,409 Views)

With the array to spreadsheet string how do you put in the prompter/file so that it asks? Do I sitll have to put a write to spreadsheet after it and do as I had done prior to wanting to format?

0 Kudos
Message 27 of 34
(1,397 Views)

The function returns a plain string, which can be written to the disk using lower level functions.

(A string, like a file, is just a long, linear sequence of characters)

0 Kudos
Message 28 of 34
(1,394 Views)

@altenbach wrote:

RTSLVU wrote:

I have found that this formats every thing to an exact string of what ever you put into it.


Except for integers, a decimal formatted string is almost never "exact".


 

Can you give me some examples? In my experence things have been fine using %s

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 29 of 34
(1,391 Views)

Not sure what is meant by lower level functions. At the moment I can run it just fine. The problem is it makes it to the array to spreadsheet and does not ask for a place to save etc but still continues looping like its supposed to. Therefore I have not a clue where it is going if anywhere. My question is then how can the array to spreadsheet be modified so that it works like the write to spreadsheet where we can use a control or a feedback node to prompt once then keep running? I am confused what to do with the pink string after the array to spreadsheet and what is supposed to be attched to that to be usable. String constant? String control, in which case do we pick a file there etc?

0 Kudos
Message 30 of 34
(1,387 Views)