Check out our VI Scripting Code Repository Files and visit the LabVIEW Wiki VI Scripting article
Tags |
(This content has not been tagged yet)
|
![]() |
Sep 30 2005, 08:43 PM
Post
#1
|
|||
![]() Confucius say: Crowded elevator always smell different to midget 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
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. -------------------- Thank You
Michael Aivaliotis - Follow me on Twitter - My Personal Blog Search the LabVIEW Web - Build the LabVIEW Web - Got VIPM? ![]()
|
||
|
|
|||
| Ad |
Sep 30 2005, 08:43 PM
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
|
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)
Read_String_Array.vi ( 44.28K )
Number of downloads: 180
Build_Case.vi ( 12.96K )
Number of downloads: 187
|
||
|
|
|||
Oct 1 2005, 04:10 AM
Post
#3
|
|||
![]() Confucius say: Crowded elevator always smell different to midget 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
My Blog
My Gallery
|
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 -------------------- Thank You
Michael Aivaliotis - Follow me on Twitter - My Personal Blog Search the LabVIEW Web - Build the LabVIEW Web - Got VIPM? ![]()
|
||
|
|
|||
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 ,.
|
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.
Create_Case_Struct_from_String_Array.vi ( 97.61K )
Number of downloads: 189BTW, it will be possible in LabVIEW8. We just need to figure out how to get scriptig exposed again. Regards, Scott Menjoulet
|
|||
|
|
||||
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
|
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!
Create_String_Case_Struct_from_Array.vi ( 129.27K )
Number of downloads: 145This 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) *************************************************************
|
||
|
|
|||
Oct 12 2005, 01:36 AM
Post
#6
|
||||
![]() Confucius say: Crowded elevator always smell different to midget 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
My Blog
My Gallery
|
BTW, it will be possible in LabVIEW8. We just need to figure out how to get scriptig exposed again. Regards, Scott Menjoulet uhum... you tried to hide it in the image, but I can still tell what version of LabVIEW you're running... -------------------- Thank You
Michael Aivaliotis - Follow me on Twitter - My Personal Blog Search the LabVIEW Web - Build the LabVIEW Web - Got VIPM? ![]()
|
|||
|
|
||||
![]() ![]() |
| Time is now: 8th January 2009 - 11:56 PM |