Jump to content


Photo
- - - - -

Configuring XControls using an .ini file


  • Please log in to reply
4 replies to this topic

#1 mariuszl2

mariuszl2

    Active

  • Members
  • Pip
  • 10 posts
  • Version:LabVIEW 2010
  • Since:2009

Posted 07 August 2012 - 05:38 AM

Hi. I have a front panel that consists of 30 XControls. Depending on the test each of them has to have different caption and position.
I use an .ini file to read the configuration data and assign it to the specific XControl.


Posted Image

But if I have many Xcontrols i have to create separate Property Nodes and assign the data for every control separately. Is there a way to put this inside a loop so the code uses smaller area of the screen?

#2 shoneill

shoneill

    Extremely Active

  • Members
  • PipPipPipPip
  • 442 posts

Posted 07 August 2012 - 06:33 AM

Why doesn't the XControl initialise itself. That way there's much less code on your VI Block diagram.

#3 asbo

asbo

    I have no idea what you're talking about... so:

  • V I Engineering, Inc.
  • 1,273 posts
  • Version:LabVIEW 2011
  • Since:2008

Posted 07 August 2012 - 02:07 PM

shoneill's suggestion makes the more sense, but if you can't do that, build an array of the XControl references, wire that into a for loop, and go to town.

#4 mariuszl2

mariuszl2

    Active

  • Members
  • Pip
  • 10 posts
  • Version:LabVIEW 2010
  • Since:2009

Posted 07 August 2012 - 06:34 PM

I build an array of references and managed to do what I wanted. Sadly, I dont understand shoneill's suggestion. Can You be more specific? How can it initialize itself?

Edited by mariuszl2, 07 August 2012 - 06:34 PM.


#5 Ton Plomp

Ton Plomp

    How many lines per hour? Zero!

  • Premium Member
  • 1,973 posts
  • Location:Netherlands
  • Version:LabVIEW 2012
  • Since:2000

Posted 08 August 2012 - 10:27 AM

In your init state of the XControl you could read the settings from the configuration file and load them.
If the XControl is an initial drop the previous version is different than 0.0.0.0, and you can get the label of the control to read the ini section.

Ton