02-13-2023 10:22 AM
Hello and good day!
Been using mostly LV 2015 in the past years, also have LV 2021 installed and for a new project I decided to use it and found a new and for me annoying behavior. A string indicator automatically
submits the text of a constant when just placing
on the block diagram and without ever having run the code once. This is not wanted. How to turn that off? I couldn't find any setting for this in the options.
Solved! Go to Solution.
02-13-2023 10:29 AM
Sorry, cannot test, but you need to be significantly more specific. What are you placing and in what order. What is "submit"?
(If you have an indicator that has contains data and you right-click...create constant, you get a constant with the current value of the indicator. Are you talking about that or something else?)
02-13-2023 12:27 PM
Like @altenbach, I don't know what you mean by "submits the text of a constant when just placing". Here's what I did:
At this point, I have LabVIEW code identical to the "picture" of some LabVIEW code you had in your Post. On my code's Front Panel, the String Indicator remains blank, which is what I expect (as data doesn't "run" in a wire if LabVIEW is not running it). Of course, if I push the Run Arrow, the indicator displays "Hallo". [Y'know, I hadn't tested that the previous sentence was true, but I just did what I said, and the indicator does say "Hallo". Whew!]. Incidentally, I could easily clear the String by right-clicking the Indicator and (on the Edit menu) choose the Data Operation "Reinitialize to the Default Value". Wait, did you make your Control have "Hallo" as the Default Value?
If you have LabVIEW code that behaves differently, submit your code (this would be a file with the extension ".vi", produced by LabVIEW). Incidentally, I'm doing all of this using NI LabVIEW 2021 SP1 (32-bit).
Bob Schor
02-13-2023 02:05 PM - edited 02-13-2023 02:06 PM
I think you're both interpreting this the wrong way. Do it this way:
If this was only cosmetic that would be one thing, but on closer inspection, this has actually made the string indicator with the value of "Hallo" as the default value.
Unfortunately I don't know how to turn this off, assuming this is what the complaint is about.
02-13-2023 02:11 PM
@Kyle97330 wrote:
I think you're both interpreting this the wrong way. Do it this way:
- Place down a string constant
- Put "Hallo" in it
- Right-click the constant, choose "Create Indicator".
- DO NOT RUN THE VI, EVER
- Look at the front panel
- See:on the front panel
If this was only cosmetic that would be one thing, but on closer inspection, this has actually made the string indicator with the value of "Hallo" as the default value.
Unfortunately I don't know how to turn this off, assuming this is what the complaint is about.
I can confirm that this behaviour happens in LV2020 as well. Including the part about setting it as the default value.
I cannot say that I have ever noticed this before.
02-13-2023 02:35 PM
@Kyle97330 wrote:
I think you're both interpreting this the wrong way. Do it this way:
- Place down a string constant
- Put "Hallo" in it
- Right-click the constant, choose "Create Indicator".
- DO NOT RUN THE VI, EVER
- Look at the front panel
- See:on the front panel
If this was only cosmetic that would be one thing, but on closer inspection, this has actually made the string indicator with the value of "Hallo" as the default value.
Unfortunately I don't know how to turn this off, assuming this is what the complaint is about.
You right click on a Constant and select "Create Indicator"
LabVIEW creates an indicator that contains the value of the constant you used to create it.
That's how it has always been as far as I can remember and I'm not sure what other behavior you would expect?
02-13-2023 02:48 PM
I agree with RTSLVU. I can't think of any default behavior that would be more convenient and expected than what it currently is. Whether a constant, control or indicator; they all act just like you cut and pasted or cntl drag and dropped them. If they have content, it is copied. If they don't, it's blank. Sounds right to me. 🤔
02-13-2023 09:21 PM
I tried to read the Release Notes for LabVIEW 2020 and 2021 to see if this "modification" to setting Default Values for String Indicators (or Controls?) was described, but I didn't find any mention of this (I find the new format for Documentation somewhat difficult to use and sparse in information, so I may have missed it).
I also agree with @RTSLVU and @NIquist that this is not a "serious bug", and may be a "trivial improvement".
Bob Schor
02-13-2023 09:42 PM
Agree with @RTSLVU, this is how I remember using it so far.
If you create from a Constant, the indicator copies the value and vice versa.
02-14-2023 02:05 AM - edited 02-14-2023 02:09 AM
It's so weird! I've been using LV for so long now and never noticed it myself. It depends on how and where you connect. I was so absolutely sure, LV 2015 wouldn't do that.
Apart from that, it still appears strange to me that it would do it. Passing variables/constants to an indicator should only occur when running the code. Now I also still wonder if there is a way to turn that off...
Sorry to all for wasting your time. 😒