LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need your Feedback for a VI

Thank you! Could somebody please review the another VI ? 🙂 paragraph_format.png

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

0 Kudos
Message 11 of 23
(1,325 Views)

Step 2 can be replaced with a simple Search And Replace String.  There is an input on the top to "Replace All".  Set that to TRUE.  And make sure the Replace String is an empty string.

 

I think we have already beat that Space Generator do death already, so you might want to go ahead and replace that.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 12 of 23
(1,315 Views)

@AldhairGarza wrote:

Thank you! Could somebody please review the another VI ? 🙂 


(Tim already mentioned a few things)

 

  • The "information" part belongs into a diagram disable structure, in fact it could just be a diagram comment. No need for code and indicators.
  • Again, the "space available" constants need to be I32. They are integers.
  • If you divide using "quotient and remainder" function instead, it will operate on integers and the "floor" is the rounded down value you need. This also eliminates the "round towards -inf" and "To I32". Much cleaner and all blue!
  • Yes, use "search and replace string (replace all=True!)". No step 2 loop needed.
  • Step 5 could be replaced by "trim whitespace".
  • Same for step 3
  • step 4. There is "=0" primitive. Instead of the case structure, use a "select" and either concatenate the whitespace or an empty string. no need for a case structure.
  • etc. ...
Message 13 of 23
(1,298 Views)

Wow how silly I am. I really appreciate your help thank you very much.

The mentioned Step does not eliminate whitespace, it just checks where was the last one so when the "Replace Substring" extracts a line of text, it doesn't cut a word in half.

 

I did all the rest you said, but are you sure that it is better to replace the Case Structure for a Select ? 

Because with the Case Structure it was a bit cleaner, but I'm just nobody, I don't really know.

 

This was the final result. If you have any further observations, i'd be glad to read them.

 

paragraph_formatting.png

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

0 Kudos
Message 14 of 23
(1,282 Views)

@AldhairGarza wrote:

The mentioned Step does not eliminate whitespace, it just checks where was the last one so when the "Replace Substring" extracts a line of text, it doesn't cut a word in half. 


Well, I did not really study the code, just looked at the diagram label. Maybe you should rewrite the label and explain better what the loop actually does. 😄

 


@AldhairGarza wrote:

 

I did all the rest you said, but are you sure that it is better to replace the Case Structure for a Select ? 

Because with the Case Structure it was a bit cleaner, but I'm just nobody, I don't really know.


"Cleaner" is subjective. With the case structure you had to duplicate the "concatenate strings" and operate on several input tunnels. We also cannot immediately tell what's in the other case by looking at the image. The "select" switches exactly one input to the next operation. Also, since it is just a concatenation, I probably would not use a formatting statement.

 


@AldhairGarza wrote:

 

This was the final result. If you have any further observations, i'd be glad to read them. 


Nothing is ever "final". 😄 I might have a look later.

Message 15 of 23
(1,272 Views)

haha yeah that's what I thought, it's a simple VI that you guys can understand without problem.

 

Thanks for the explanation about the Case Structure and the Select. I get it.

 

 


Nothing is ever "final". 😄 I might have a look later.


I'll be waiting! 

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

0 Kudos
Message 16 of 23
(1,267 Views)

Not sure if I have time today, but I have the feeling that the two FOR loops could be combined into one.

Message 17 of 23
(1,261 Views)

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.paragraph_formatting.png

 

 

 

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

0 Kudos
Message 18 of 23
(1,256 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 19 of 23
(1,247 Views)

When you have a string constant like \n where I would assume that is a new line character and not a backslash "n", then show the display format on the string constant so it is obvious it is in \code mode.

Message 20 of 23
(1,243 Views)