11-17-2016 11:08 AM - edited 11-17-2016 11:10 AM
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:
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?
Solved! Go to Solution.
11-17-2016 11:41 AM
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:
11-17-2016 11:45 AM
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.
11-17-2016 12:16 PM
@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?
11-17-2016 01:18 PM - edited 11-17-2016 01:19 PM
@EngrStudent wrote:
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 🙂