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: 

strings and white space

Hi,

 

I'm doing some string manipulation and have  found a feature of labview I need to get around.

I appears that Labview does not consider a space as part of a sting but a delimiter.

 

As a consequence I find that the Path vi only returns the path up to a space in the name.

 

 I also wish to append a string with a space to another string. I find that if the first string has a space in it, only the first part is appended.

 

I've looked at a few tutorials but can't find anything to help.

 

Can anyone shed some light on how to include spaces as part of the string.

 

Cheers

 

Andy

0 Kudos
Message 1 of 7
(3,392 Views)

@AndyNC wrote:

I'm doing some string manipulation and have  found a feature of labview I need to get around.

I appears that Labview does not consider a space as part of a sting but a delimiter.



What your saying seems false. What is your LabVIEW version? What is your OS?

 


@AndyNC wrote:

As a consequence I find that the Path vi only returns the path up to a space in the name. 


I am not familiar with Path.vi. Can you tell us where you found it and possibly attach it? Earlier you talked about strings, but now you are talking about paths. I assume you are aware that they are not the same in LabVIEW.

 


@AndyNC wrote:

I also wish to append a string with a space to another string. I find that if the first string has a space in it, only the first part is appended.


Again, that is not correct. Please attach an actual VI example that demonstrates the problem.

0 Kudos
Message 2 of 7
(3,389 Views)

Thankyou for your response

 

I'm using LabVIEW 2010 on Win XP

 

For the concat of strings I've attached StringConcat.vi. It shows Max Value is trimmed to Max and the number 101.66.. is not appended. I'm probably missing something simple here. ( this has been cut out of a larger vi)

 

I'm using the "Current Vi's path" which is in the file constants pallete.

I've attached a simple VI that shows the problem.

If I run it from C:\Labview\ I get "C:\Labview\"

If I run it from C:\Lab view\ I get "C:\Lab view\"

 

But if I run it under C:\My Documents\   I get "C:\My"

 

It's very inconsistant.

Thanks

 

Andy

 

 

Download All
0 Kudos
Message 3 of 7
(3,366 Views)

Hi Andy.

 

 Both programs work as expected for me, but I had to make the front pannel indicator larger to see all the text.

 

Ian

0 Kudos
Message 4 of 7
(3,361 Views)

I made the front panel indicator large as well but I still have these problems.

To me this indicates an underlying difference in the operation of my system versus yours. ie a setting somewhere that needs changing.

 

Is there some setup difference that treats strings differently. I know it's clutching at straws but it doesn't work on my machine.

 

Cheers

 

Andy

0 Kudos
Message 5 of 7
(3,355 Views)

I'm also running LV2010 and Win XP.

It works as it should for me too, once I'd made the indicator big enough to see all of the contents.

 

MC

0 Kudos
Message 6 of 7
(3,350 Views)

I've just made them even longer and it works OK.

 

I can now see what's happening. The indicator will only display complete blocks of non-whitespace.

I certainly was not expecting this behaviour. I'm used to edit boxes which will display as much of a string as possible and simply truncate what won't fit in the box.

 

It's diverted me from my original problem which I can now get back to.

 

Many thanks to all.

0 Kudos
Message 7 of 7
(3,347 Views)