LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

concatenate string

Solved!
Go to solution

Hello,

 

I was working on a simple program and found the problem whose image is attached in this post. I have a cluster of 31 elements, and I am concatenating all inputs and also using end of line constant.

If I dont use end of line constant, data from outrush_limit_state (cluster element) & vo1(cluster element) appear in same line,.

After using end of line constant, I can see that there is blank line between 2 values in the final output (which I want to see) but not with some data, why is this behavior?

I am using 8.6.

What basic understanding am I missing ?

Download All
0 Kudos
Message 1 of 7
(8,027 Views)

Can you post your actual code with data? It would be much easier to help that way.

Tim
GHSP
0 Kudos
Message 2 of 7
(8,001 Views)
Solution
Accepted by topic author systemcrash

 

1) Are you sure that the individual strings don't have a new line / carriage return already appended to them?

2) Are you sure your text box is wide enough and isn't somehow wrapping the text?

 

I ask 1) because your front panel is showing a blank line... you wouldn't get this from concatenating a EOL. The EOL would just give you a new line, not a blank line. The offending outputs may be missing an new line character whilst the others are not.

 

As always, posting some code and default data would help...

Message 3 of 7
(7,997 Views)

A single EOL should not give you a blank line separator.  That takes two EOLs.  You seem to have some EOLs embedded in your original text strings.  Show the codes on your output text string and you will probably see them (right click string indicator and select '\' Codes Display).  Do not be surprised if you see either CR or LF by itself next to your EOL (which is a CR/LF in Windows).  You can also create a custom probe with the codes shown to probe your original values.

0 Kudos
Message 4 of 7
(7,990 Views)

Please...

 

  1. call your VI with the panel open so update cluster contains typical data
  2. RIght-click the update cluster terminal... change to constant
  3. copy the constant to the diagram of a new VI.
  4. Save and attach the new VI.

If you really want all cluster elements in the existing cluster order, your current code can be replaced by "cluster to array" followed by "array to spreadsheet string with newline as delimiter. To cleanup your array elements, use "trim whitespace" first.

0 Kudos
Message 5 of 7
(7,961 Views)

Thanks all for the reply, had forgotten that response what I am getting from serial device adds new line character, I used trim whitespace to remove unrequired stuff, I am getting what I expect. Its all good, thanks

0 Kudos
Message 6 of 7
(7,951 Views)

Staying on topic, don't forget to support Jim's Idea to make "trim whitespace" work on arrays directly. 😄

0 Kudos
Message 7 of 7
(7,936 Views)