05-07-2010 10:14 AM
Hi all
I am trying to send the names and values of controls to a subvi.
I know that I can extract the name and value of the control using a property node, but I was looking for a way to make is easy to use for the programmer.
I am thinking of some kind of bundle function, it saves the name and value of the control, but I would like the programmer to be able to connect a random number
of controls to this subvi without having to specify the number of controls anywer.
I know there is configuration file stuff in labview, but it looks a bit more complex then what I want to do.
Also i know that I can use the OpenG toolkit, but I'll rather not use any add-ons to labview, as this VI might be running on many different computers.
Hope I made my problem clear enough!
Have a nice day
Regards
Tommy
Solved! Go to Solution.
05-07-2010 10:23 AM - edited 05-07-2010 10:24 AM
tombech wrote:Hi all
I am trying to send the names and values of controls to a subvi. I know that I can extract the name and value of the control using a property node, but I was looking for a way to make is easy to use for the programmer.
It sounds like a job for scripting if you don't want to do it this way.
I am thinking of some kind of bundle function, it saves the name and value of the control, but I would like the programmer to be able to connect a random number of controls to this subvi without having to specify the number of controls anywer.
Do this with an array of name/value clusters.
Also i know that I can use the OpenG toolkit, but I'll rather not use any add-ons to labview, as this VI might be running on many different computers.
I wouldn't let this stop you. You'd gain a lot by installing OpenG VIs on all of your development computers.
05-07-2010 10:34 AM
tombech wrote:Hi all
I am trying to send the names and values of controls to a subvi.
I know that I can extract the name and value of the control using a property node, but I was looking for a way to make is easy to use for the programmer.
I am thinking of some kind of bundle function, it saves the name and value of the control, but I would like the programmer to be able to connect a random number
of controls to this subvi without having to specify the number of controls anywer.
I know there is configuration file stuff in labview, but it looks a bit more complex then what I want to do.
Also i know that I can use the OpenG toolkit, but I'll rather not use any add-ons to labview, as this VI might be running on many different computers.
Hope I made my problem clear enough!
Have a nice day
Regards
Tommy
I am not sure what you have in mind Tommy but lets rule out the rediculous.
You can find a Nugget I wrote here that explains how I managed to write an Save/Restore function that will automatically adapt to a type-def'd cluster. THat Nugget include my original source code as well as a full description of what where why and how.
I have used that code in multiple applications and it has demonstrated that it works.
No not all data types are supported! I left that as an exercise for the reader.
Ben
05-07-2010 11:42 AM
What about creating an array of control references. On the main, you would have to populate the array with the control references you wish to send to the subvi. In the subvi, use a For Loop with indexing to get each reference, then use property nodes to get the name and value.
05-07-2010 11:58 AM
Hi Guys
Thanks for the replys !
I ended up building a 1D array with references to each control (only numeric controls) , and passed this to my SubVI
from there I extracted the names and values with a property node in a for loop and converted this to a string which I saved in the file header.
Thanks and have a nice day
Regards
Tommy
05-07-2010 02:46 PM
Hey Tomi,
> Also i know that I can use the OpenG toolkit, but I'll rather not use any add-ons to labview, as this VI might be running on many different computers.
At the risk of sounding like a salesman...
VIPM Community makes this very easy. (as Jim C. said -- don't let this stop you.)
And, VIPM Professional makes it eaven easier by allowing you to perform configuration management, so that you can very easily and quickly get the (package/add-on) configurations of all your computers synchronized.
Cheers,
-Jim
05-07-2010 05:58 PM
Jim Kring wrote:
Hey Tomi,
Oops, I meant "Tommy", not "Tomi" -- I work with a Tomi, and my fingers were on auto-pilot 🙂
05-08-2010 03:57 PM
Jim Kring wrote:
Jim Kring wrote:
Hey Tomi,
Oops, I meant "Tommy", not "Tomi" -- I work with a Tomi, and my fingers were on auto-pilot 🙂
Thats just NOT acceptabe, I am very hurt now!!
.......
.......
Hehe only kidding, thats what happens when you are multitasking 🐵
Have a nice weekend!