LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV 2021 automatically fills indicator

Solved!
Go to solution

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 

MaSta_0-1676304648913.png

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.

 

0 Kudos
Message 1 of 15
(1,161 Views)

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?)

 

Message 2 of 15
(1,157 Views)

Like @altenbach, I don't know what you mean by "submits the text of a constant when just placing".  Here's what I did:

  1. Created a String Indicator on the Front Panel named "String".
  2. On the Block Diagram, created a String Constant and put the string "Hallo" inside it.
  3. Wired (on the Block Diagram). the String Constant to the String Indicator.

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

Message 3 of 15
(1,130 Views)

I think you're both interpreting this the wrong way.  Do it this way:

 

  1. Place down a string constant
  2. Put "Hallo" in it
  3. Right-click the constant, choose "Create Indicator".
  4. DO NOT RUN THE VI, EVER
  5. Look at the front panel
  6. See:Kyle97330_0-1676318351612.pngon 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.

Message 4 of 15
(1,103 Views)

@Kyle97330 wrote:

I think you're both interpreting this the wrong way.  Do it this way:

 

  1. Place down a string constant
  2. Put "Hallo" in it
  3. Right-click the constant, choose "Create Indicator".
  4. DO NOT RUN THE VI, EVER
  5. Look at the front panel
  6. See:Kyle97330_0-1676318351612.pngon 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.

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
Message 5 of 15
(1,097 Views)
Solution
Accepted by topic author MaSta

@Kyle97330 wrote:

I think you're both interpreting this the wrong way.  Do it this way:

 

  1. Place down a string constant
  2. Put "Hallo" in it
  3. Right-click the constant, choose "Create Indicator".
  4. DO NOT RUN THE VI, EVER
  5. Look at the front panel
  6. See:Kyle97330_0-1676318351612.pngon 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?

========================
=== Engineer Ambiguously ===
========================
Message 6 of 15
(1,088 Views)

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.  🤔

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 7 of 15
(1,083 Views)

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

Message 8 of 15
(1,012 Views)

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.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 9 of 15
(1,004 Views)

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. 😒

0 Kudos
Message 10 of 15
(977 Views)