LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Check out our VI Scripting Code Repository Files and visit the LabVIEW Wiki VI Scripting article


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> Generate case structure frames based on string array., Anyone got this coded up?
Michael_Aivaliot...
post Sep 30 2005, 08:43 PM
Post #1


Confucius say: Crowded elevator always smell different to midget
Group Icon
*****

Admin
Posts: 2402
Joined: 13-October 02
From: Planet Earth
Member No.: 2
Using LabVIEW Since:1994
LV:8.5 ,8.2.1 ,7.1.1
Greece Canada United States My Blog My Gallery


Trying to find someone that has the following already:

Take an array of strings and generate a "string type" case structure that has a case for every element in the array.

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Sep 30 2005, 08:43 PM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
lavezza
post Oct 1 2005, 02:25 AM
Post #2


More Active
**

Member
Posts: 49
Joined: 28-October 03
From: Phoenix, AZ
Member No.: 192
Using LabVIEW Since:1996
LV:7.1.1 ,8.2.1 ,8.5
United States us_arizona us_florida


I'm sure there is a nifty way to do this with scripting, but I haven't learned any of that yet. Below are two VIs that work together to do what you want. I'm sure much more functionality can be added. Follow the instructions on the front panel of Read_String_Array.vi. You will need both VIs.

Pat
Attached File(s)
Attached File  Read_String_Array.vi ( 44.28K ) Number of downloads: 180
Attached File  Build_Case.vi ( 12.96K ) Number of downloads: 187
 


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Michael_Aivaliot...
post Oct 1 2005, 04:10 AM
Post #3


Confucius say: Crowded elevator always smell different to midget
Group Icon
*****

Admin
Posts: 2402
Joined: 13-October 02
From: Planet Earth
Member No.: 2
Using LabVIEW Since:1994
LV:8.5 ,8.2.1 ,7.1.1
Greece Canada United States My Blog My Gallery


QUOTE (lavezza @ Sep 30 2005, 07:25 PM) *
I'm sure there is a nifty way to do this with scripting, but I haven't learned any of that yet. Below are two VIs that work together to do what you want. I'm sure much more functionality can be added. Follow the instructions on the front panel of Read_String_Array.vi. You will need both VIs.

Pat

Nice little trick. Doesn't use scripting but is still a big time saver. Thanks thumbup1.gif

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
smenjoulet
post Oct 6 2005, 10:57 PM
Post #4


Active
*

Premium Member
Posts: 15
Joined: 17-May 04
From: Dallas, TX
Member No.: 415
Using LabVIEW Since:1992
LV:8.2.1 ,7.1 ,.
United States us_texas us_michigan


Well, I thought I'd take a few minutes and see what I could find. It doesn't appear to be doable via scripting in the way you would think, i.e. the "SelStrings" property of the Case Selector. The "SelStrings" property is read-only as I'm sure you're aware, and there doesn't seem to be any other proprty or method that allows setting of the strings. So I don't think it's directly possible in 7.1 (at least not without additional unknown "superSecret" help).

Having said that I coded up this little beast just for fun that will accomplish the task. Certainly nothing revolutionary, it just just a scripting version of Pat's 2 VI method.

Attached File  Create_Case_Struct_from_String_Array.vi ( 97.61K ) Number of downloads: 189


BTW, it will be possible in LabVIEW8. We just need to figure out how to get scriptig exposed again. biggrin.gif

Attached Image


Regards,
Scott Menjoulet


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Mike Ashe
post Oct 11 2005, 05:51 PM
Post #5


Instant Human, just add coffee
****

Premium Member
Posts: 889
Joined: 31-January 03
From: Waterford, CT USA
Member No.: 45
Using LabVIEW Since:1992
LV:8.2.1 ,7.1 ,8.0.1
United States us_connecticut us_washington


Nifty little scripting tool. Now if you also create a string constant or control and wire it to the new CASE selector node, it will convert the CASE from ENUM to string mode, save a voila!Attached File  Create_String_Case_Struct_from_Array.vi ( 129.27K ) Number of downloads: 145


This post has been edited by Michael Ashe: Oct 11 2005, 06:11 PM

--------------------
*************************************************************
"Always listen to the experts, they'll tell you what can't be done, and why.
Then go do it."
~The Notebooks of Lazarus Long (by Robert Heinlein)
*************************************************************


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Michael_Aivaliot...
post Oct 12 2005, 01:36 AM
Post #6


Confucius say: Crowded elevator always smell different to midget
Group Icon
*****

Admin
Posts: 2402
Joined: 13-October 02
From: Planet Earth
Member No.: 2
Using LabVIEW Since:1994
LV:8.5 ,8.2.1 ,7.1.1
Greece Canada United States My Blog My Gallery


QUOTE (smenjoulet @ Oct 6 2005, 03:57 PM) *
BTW, it will be possible in LabVIEW8. We just need to figure out how to get scriptig exposed again. biggrin.gif

Attached Image


Regards,
Scott Menjoulet

uhum... you tried to hide it in the image, but I can still tell what version of LabVIEW you're running... ninja.gif

--------------------


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 8th January 2009 - 11:56 PM