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: 

Format into String

I have the attached VI to change several data points into a string to write into an Excel file. The problem being, it places the data points in the incorrect places as shwon with the two Excel files. The blank spots should be from just empty string constants. Does anyone know why it does this. I use the tab separator as with the opening portion, and that seems correct. Why are the data points different and not in the correct spots?

JohnGalt

Message Edited by JohnGalt on 05-18-2006 12:55 PM

----------------------------------------------------------------------------------------------------------------------------------------------------
I've got a sneaking suspicion that Jesus might have been made of bread. Why else did they have to put him in a warm cave and wait three days for him to rise?

Damnant quadnon intelligunt - They condemn what they do not understand.
0 Kudos
Message 1 of 5
(3,318 Views)
You've made things much more complex than they need to be and you've made mistakes in where you've put the tab separators. For example, the CHAMP and CBP headings. I think you wanted a tab between them but you've got no separator at all. Make it simpler by creating an array of just the headers and using Array to Spreadsheet String. Then you don't have to use that big and ugly Concantanate Strings and worry about what is wired where. Second, you can use the Format Into String better. Instead of wiring your tabs as inputs, specify them in the format string. Then you would have something like %s\t%s\t%s\t and so on. Then you only have to wire data into Format Into String and it will be easier to wire and debug.
Message 2 of 5
(3,301 Views)

Here is sort of what Dennis is talking about. Caution, if you look at the format string with "\" Codes Display, you will see that I changed all the spaces (\s) to tabs (\t). But if you click on the "format into string" function and select "Edit Format String" it will convert them (tabs) into "output exact strings" \t, which aren't tabs, they are \ and t characters. There are other things that can be done, and you probably want to output the header data seperately, rather than passing it through the format into string, so that you can put it in a loop to write continually updated data. Handling strings appears obnoxious in LabVIEW, but can end up being pretty powerful.

 

 

This was done in LabVIEW 7.1

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 5
(3,268 Views)

And saved in 7.0 (as I see that was what yours was in)

 

 

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 4 of 5
(3,267 Views)
The problem seems to be fixed. I just converted most of the strings into numeric values and it all works fine. I think that some of the data was looking like tab or EOL commands to the computer. The numerics never seem to get mixed up.
----------------------------------------------------------------------------------------------------------------------------------------------------
I've got a sneaking suspicion that Jesus might have been made of bread. Why else did they have to put him in a warm cave and wait three days for him to rise?

Damnant quadnon intelligunt - They condemn what they do not understand.
0 Kudos
Message 5 of 5
(3,233 Views)