LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need your Feedback for a VI


@crossrulz wrote:

Move your space generation to be outside of the loop.  That is something that should only need calculated once, so no need to do it every iteration of the loop.


Yes, and because the "numeric" control is inside the loop, the compiler cannot move that part out of the loop behind the scenes. It needs to assume that the control can be changed by the user during the execution of the loop.

 

Do you have a typical value for the message string after the first subVI? 

Message 21 of 23
(560 Views)

@AldhairGarza wrote:

Yes it's possible! I was thinking about that while I was creating the VI for the first time but didn't retake the Idea later.


Also note that you are actually getting the remainder instead of the floor to determine the number of iterations. Ooops! If the length of your string is divisible by the windows size, you only get one iteration, irrespective of the length of the input. You need to wire from the bottom output of "quotient&remainder". Be careful there!

 

Also, when you replace all \n with empty strings, there is a theoretical danger (depending on how the string comes in) that you'll end up merging two words if they are only separated by a \n. Can you guarantee that each newline follows a space character?

Message 22 of 23
(557 Views)

I didn't see that with the remainder thanks.

 

Also, when you replace all \n with empty strings, there is a theoretical danger (depending on how the string comes in) that you'll end up merging two words if they are only separated by a \n. Can you guarantee that each newline follows a space character?

Yes that actually happened once but i think replacing the empty string with a Space String solves the problem, doesn't it? paragraph_format_v_.png

The last constant in the Concatenating of Strings can be also outside, but it makes the code less readable, right?.

 

Thanks again for taking your time.

 

I attached the text file. Yes, there's a "problem" with the "===========" but I will work on that later.

=======
My Channel: https://www.youtube.com/@LV_Lab

Download All
0 Kudos
Message 23 of 23
(541 Views)