LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send name and value of control to subvi

Solved!
Go to solution

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

-----
Running LabVIEW 2009 32bit SP1 on Windows 7 64Bit
0 Kudos
Message 1 of 8
(3,248 Views)

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.

Message Edited by jcarmody on 05-07-2010 11:24 AM
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 2 of 8
(3,246 Views)

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. Smiley Surprised

 

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. Smiley Wink

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 8
(3,233 Views)
Solution
Accepted by topic author tombech

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.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 8
(3,206 Views)

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

 

 

-----
Running LabVIEW 2009 32bit SP1 on Windows 7 64Bit
0 Kudos
Message 5 of 8
(3,202 Views)

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

0 Kudos
Message 6 of 8
(3,172 Views)

Jim Kring wrote:

 

Hey Tomi,



 

 

Oops, I meant "Tommy", not "Tomi" -- I work with a Tomi, and my fingers were on auto-pilot 🙂

0 Kudos
Message 7 of 8
(3,155 Views)

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!

-----
Running LabVIEW 2009 32bit SP1 on Windows 7 64Bit
0 Kudos
Message 8 of 8
(3,122 Views)