05-05-2015 03:11 PM
Okay this might be a little OCD (or CDO because my OCD-ness wants it to be in alphabetical order), but I've noticed that the justification of string constants on the block diagram are different if the constant is made from a Create >> Constant, or the empty string constant.
So lets say I drop down a String Constant from the String palette. It will be left justified, when new lines are entered it is quite obvious. But if you drop down a Trim String.vi and right click the input and choose Create >> Constant. That constant will now be right justified. This appears to be the case for all Create Constants that create a string. NI can you be consistent? Am I going crazy and bigger things matter? Thanks.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-05-2015 05:59 PM
I don't really have an answer here but it might make you feel a little less crazy that this behavior is already documented in CAR #60898. I also looked for ini tokens or environment options to change the default justification behavior but could not find anything.
I think your post has also put the Cannot Unsee Curse on me.
05-05-2015 11:52 PM
Curse you hoovah.
Now that I know this it will be impossible to avoid. This does also seem to explain why I could never remember which way string constants expanded when typed into, which annoyed me when trying to make everthing look neat and tidy. At least now that the cause is known I can remember to simply work off one method of generating strings, either that or go through justifying everything.
05-06-2015 06:33 AM
@Hooovahh wrote:
So lets say I drop down a String Constant from the String palette. It will be left justified, when new lines are entered it is quite obvious. But if you drop down a Trim String.vi and right click the input and choose Create >> Constant. That constant will now be right justified. This appears to be the case for all Create Constants that create a string. NI can you be consistent? Am I going crazy and bigger things matter? Thanks.
If you think about it, this makes perfect sense. The constant would expand naturally to the left as you enter text into it. If you edit a constant created from the palette, it can overrun the node as you type.
Following the standard of code flowing from left to right, this would keep your block diagram looking nice and clean when editing. I'll bet it was always this way...
The question for me would be, did the addition of block diagram cleanup require significant amounts of extra coding to evaluate the justification and size of every constant to determine the absolute coords to be used to locate the text?
05-06-2015 07:27 AM - edited 05-06-2015 07:37 AM
Great discussion guys, on such a small function. I agree with the expand left to not put text on top of a subVI or other node. But how often do you drop down a constant, type stuff, and then leave it? For me almost never. I will create a constant type what I want, then move it where I want it to go. Rarely do I have a function that has an input and where the constant is made is sufficient, usually because there are many other inputs and I need to move things around a bit to not have things hidden behind wires.
BTW this behavior is the same for numeric constants so I'd assume PhillipBrooks assesment is correct.
This was discovered because during a code review of a JKI state machine, someone mentioned that the developer should stick to a string justification of either right or left, not to mix them. After playing around this was found as the reason, the some constants were made one way some another. Scripting to the rescue!
EDIT: But now that I think about it numeric constants are fine, because they are limited to one line. The justification doesn't matter from a readability stand point, just a string with multiple lines is affected.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-06-2015 09:32 AM
I'm with Phillip on this being intended and sensible behaviour. In fact I curse every time I forget and drop a string constant where I want it to be (next to a vi input) and start typing only to have it expand and cover my vi. I kick myself and say, "You fool, why didn't you just right click and create constant!" Left expanding constants are just what you want in such cases!
05-06-2015 03:08 PM
05-06-2015 03:49 PM - edited 05-06-2015 03:54 PM
@mikeporter wrote:
Ohhhh... OCD and dyslexic. Chill.
It wasn't even me that found it in a code review, so I figured if someone else was more OCD than me then I should post it to the community.
As for the bundle by name, I put the terminal labels on the side (quick drop CTRL+T) and then vertically compress and it fits perfectly for a bundle by name. Is this not what you were talking about?
EDIT: Nevermind I realize you are talking about a subVI yeah that doesn't happen to me too often. Errors on the bottom, some reference or class on top, and with a 32 by 32 icon there isn't any room to try to fit bundle terminals.
Double EDIT: Really there isn't one pattern that is the right size? Even with rotating it? I found some that are so close but nothing yet.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
05-06-2015 06:20 PM
@Hooovahh wrote:
@mikeporter wrote:
Ohhhh... OCD and dyslexic. Chill.It wasn't even me that found it in a code review, so I figured if someone else was more OCD than me then I should post it to the community.
As for the bundle by name, I put the terminal labels on the side (quick drop CTRL+T) and then vertically compress and it fits perfectly for a bundle by name. Is this not what you were talking about?
EDIT: Nevermind I realize you are talking about a subVI yeah that doesn't happen to me too often. Errors on the bottom, some reference or class on top, and with a 32 by 32 icon there isn't any room to try to fit bundle terminals.
Double EDIT: Really there isn't one pattern that is the right size? Even with rotating it? I found some that are so close but nothing yet.
And when/if you found one, you change Windows version with a different default font and booommm, all the neatly lined up wires go in bends when connected to a bundle or unbundle by name!!!! That is freaking worrysome for a true OCD person!