LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to enforce that a control is reloaded from default when a vi is run

Solved!
Go to solution

I am trying to use what LabVIEW calls "type def" as a "configuration settings store".  I hope that I am not using it in a manner inconsistent with labelling, and I think that I am not doing that because it is a version of "control".  If I'm wrong here, pleases let me know the LabVIEW or ni best practice there. 

 

My question:

I have a case structure with two cases, and in each case is a copy of the same VI that reads from a different type-def control.  Will it associate the case-specific control settings with the case when it inputs into the VI, or does the vi have instance-to-instance memory? 

 

I'm hoping that it is case specific. 

 

My approach: I made the attached, and the zero-sum at the output leads me to think that each case retains the values of the type-def.

 

When I:

  • update the type-def ( close LabVIEW, then restart it and open the ctl files, and change the value and the default, then save it, and close LabVIEW again)
  • then run the vi (open vi and hit run)

then result is that it behaves as I think it should.

 

I would like to confirm that I am not kidding myself on how vi and type-def interact in the presence of multiple type-defs going into multiple instances of the same vi.

 

Additional question: does the execution re-entrancy impact this? 

0 Kudos
Message 1 of 5
(1,550 Views)

It is a bad practice you try to do! Do NOT use any control (either typdef or not) as a "configuration settings store"! Imagine your VI in a final application as an executable. The proper way to store configuration information is a configuration file! Either you program your save/load config VIs yourself, or you can even use a toolkit:

 

http://forums.ni.com/t5/LabVIEW/How-to-convert-binary-data-from-the-front-panel-controls-into/m-p/32...

 

 

Message 2 of 5
(1,527 Views)

A type def is only a definition of the data type.

 


@EngrStudent wrote:

I have a case structure with two cases, and in each case is a copy of the same VI that reads from a different type-def control.


What you say here does not sound right at all.  You have two sources of data that have the same data type as defined by the type def.


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
0 Kudos
Message 3 of 5
(1,523 Views)

@Blokk:

 

Clarification: When I say "configuration" I do not mean system configuration.  I mean vi configuration.  It has the settings for controls that I want the VI to use during execution.

 

Does your answer still speak to that?

0 Kudos
Message 4 of 5
(1,508 Views)
Solution
Accepted by topic author EngrStudent

@EngrStudent wrote:

@Blokk:

 

Clarification: When I say "configuration" I do not mean system configuration.  I mean vi configuration.  It has the settings for controls that I want the VI to use during execution.

 

Does your answer still speak to that?


If you mean that, you want to set control values for your VI (control values on the Front Panel of the VI), my post will give you the solution. Those MGI toolkits can save front panel control configs and values into a config ini file, and reload it programmatically as you need...

 

EDit: did you check the link what I posted? There I show a snippet, download it and play with it. Then you will see if we talk about the same or not 🙂

0 Kudos
Message 5 of 5
(1,489 Views)