Check out our XNodes Code Repository Files and visit our LabVIEW Wiki XNodes Portal
Tags |
(This content has not been tagged yet)
|
![]() |
Feb 1 2007, 12:13 AM
Post
#1
|
|||
|
Changing the world, one VI at a time. JKI ![]() Posts: 1692 Joined: 22-October 02 From: San Francisco, CA Member No.: 17 Using LabVIEW Since:1995 LV:8.2.1 ,8.5 ,7.1.1
My Blog
My Gallery
|
Here are the rules:
1) Create an XNode (not an External Node) that implements the following code, in order to get the default value of anything: ![]() 2) License your VI under the BSD license. First one to complete this challenge will get a pitcher of their favorite beer at Gingerman, this year at NI Week (and possibly have thier VI included in the OpenG Toolkit). Cheers, -Jim --------------------
|
||
|
|
|||
| Ad |
Feb 1 2007, 12:13 AM
Post
#
|
||
|
|
|
||
|
|
|||
Feb 1 2007, 02:18 AM
Post
#2
|
|||
![]() I'm a LAVA, not a fighter. V I Engineering, Inc. ![]() Posts: 3740 Joined: 13-October 03 From: Michigan, USA Member No.: 181 Using LabVIEW Since:1993 LV:8.5 ,. ,.
My Blog
|
3) You have to share the beer at the Gingerman
-------------------- ![]()
|
||
|
|
|||
Feb 1 2007, 02:36 AM
Post
#3
|
|||
|
Very Active NI ![]() Posts: 213 Joined: 14-March 06 From: Austin, TX Member No.: 4441 Using LabVIEW Since:1999 LV:8.6 ,8.5 ,8.0
|
Hmm...I know nothing of these mysterious "XNodes" of which you speak, but I can accomplish what you want with a built-in function and a hidden string constant:
![]() There's an empty string hidden underneath the function and wired to to the required binary string input. You can wire whatever you want to the type input, and you'll get the default value of the data type as an output at the "value" terminal. Turn this thing into a Merge VI, give it a nifty icon, and voila...a "default value retriever". If you insist on an XNode (which, again, I know nothing about), you could wrap this trick up pretty nicely and just use the automatic type propogation of XNode terminals, if in fact such a thing existed...it would get rid of the hidden string constant, anyway. I know this won't get me a pitcher of beer, but maybe a bottle of ginger ale? -D
|
||
|
|
|||
Feb 1 2007, 02:47 AM
Post
#4
|
|||
|
Changing the world, one VI at a time. JKI ![]() Posts: 1692 Joined: 22-October 02 From: San Francisco, CA Member No.: 17 Using LabVIEW Since:1995 LV:8.2.1 ,8.5 ,7.1.1
My Blog
My Gallery
|
Hmm...I know nothing of these mysterious "XNodes" of which you speak, but I can accomplish what you want with a built-in function and a hidden string constant: ![]() There's an empty string hidden underneath the function and wired to to the required binary string input. You can wire whatever you want to the type input, and you'll get the default value of the data type as an output at the "value" terminal. Turn this thing into a Merge VI, give it a nifty icon, and voila...a "default value retriever". If you insist on an XNode (which, again, I know nothing about), you could wrap this trick up pretty nicely and just use the automatic type propogation of XNode terminals, if in fact such a thing existed...it would get rid of the hidden string constant, anyway. I know this won't get me a pitcher of beer, but maybe a bottle of ginger ale? -D I forgot to mention requirement #4: Can't crash LabVIEW. Maybe it's just me, but I've had so much bad luck with the Unflatten From String function (using invalid string/flattened data) that I shutter at the thought of this solution. Your answer wins you a body shot at Coyote Ugly. And yes, there will be photos taken that will end up on the NI Week Blog, for sure. --------------------
|
||
|
|
|||
Feb 1 2007, 03:12 AM
Post
#5
|
|||
|
Very Active NI ![]() Posts: 213 Joined: 14-March 06 From: Austin, TX Member No.: 4441 Using LabVIEW Since:1999 LV:8.6 ,8.5 ,8.0
|
Unflatten has been pretty stable for me in LabVIEW 8.2. But fine, here's another way, although this one is 48x48 pixels instead of 32x32:
![]() This was my first idea, and would probably be the easiest to wrap with one of these mythical "XNodes" I keep hearing about. -D
|
||
|
|
|||
Feb 1 2007, 08:19 AM
Post
#6
|
|||
![]() More Active Premium Member ![]() Posts: 39 Joined: 17-December 03 From: St-Hubert Member No.: 223 Using LabVIEW Since:1996 LV:8.5 ,8.6 ,.
|
Here are the rules: 1) Create an XNode (not an External Node) that implements the following code, in order to get the default value of anything: ![]() 2) License your VI under the BSD license. First one to complete this challenge will get a pitcher of their favorite beer at Gingerman, this year at NI Week (and possibly have thier VI included in the OpenG Toolkit). Cheers, -Jim Hi, there is my xnode. Finally it's an easy one, you don't have to do any scripting to get the default data.
GetDefaultData.xnode.llb ( 282.07K )
Number of downloads: 352have a nice day Dany --------------------
|
||
|
|
|||
Feb 1 2007, 02:39 PM
Post
#7
|
|||
![]() Very Active Member Posts: 138 Joined: 26-January 06 From: Cambridge, MA Member No.: 3989 Using LabVIEW Since:1999 LV:8.5 ,8.6 ,.
|
1) Create an XNode (not an External Node) that implements the following code, in order to get the default value of anything: ![]() It's not an XNode, but couldn't you do this with "Variant to Data"? Wire "anything" to "type" and an empty variant constant to the variant input.
|
||
|
|
|||
Feb 1 2007, 06:09 PM
Post
#8
|
|||
|
Changing the world, one VI at a time. JKI ![]() Posts: 1692 Joined: 22-October 02 From: San Francisco, CA Member No.: 17 Using LabVIEW Since:1995 LV:8.2.1 ,8.5 ,7.1.1
My Blog
My Gallery
|
Hi, there is my xnode. Finally it's an easy one, you don't have to do any scripting to get the default data. Great work, Dany! I hope you can make it to NI Week to collect your prize It's not an XNode, but couldn't you do this with "Variant to Data"? Wire "anything" to "type" and an empty variant constant to the variant input. Ned, this works but is plagued with the same issues as the Unflatten from String primitive (known to crash LabVIEW). So, you don't win the beer, but you do win a body shot at Coyote Ugly ;-) --------------------
|
||
|
|
|||
Feb 1 2007, 11:17 PM
Post
#9
|
|||
|
Extremely Active JKI ![]() Posts: 549 Joined: 13-September 05 From: Cary, NC USA Member No.: 2992 Using LabVIEW Since:1997 LV:8.5 ,8.2.1 ,7.1.1
|
but you do win a body shot at Coyote Ugly ;-) God Bless Coyote Ugly. -------------------- If you don't like this post, you might also not like my widgets!
|
||
|
|
|||
Feb 2 2007, 06:12 PM
Post
#10
|
|||
![]() More Active Premium Member ![]() Posts: 39 Joined: 17-December 03 From: St-Hubert Member No.: 223 Using LabVIEW Since:1996 LV:8.5 ,8.6 ,.
|
Great work, Dany! I hope you can make it to NI Week to collect your prize I don't think I will be at NI Week this year. I made its for the pleasure, not to get the prize --------------------
|
||
|
|
|||
Feb 2 2007, 06:59 PM
Post
#11
|
|||
![]() I'm a LAVA, not a fighter. V I Engineering, Inc. ![]() Posts: 3740 Joined: 13-October 03 From: Michigan, USA Member No.: 181 Using LabVIEW Since:1993 LV:8.5 ,. ,.
My Blog
|
I don't think I will be at NI Week this year. I made its for the pleasure, not to get the prize Don't worry Dany - I'll step up and accept the award on your behalf -------------------- ![]()
|
||
|
|
|||
Feb 2 2007, 07:03 PM
Post
#12
|
|||
![]() Very Active V I Engineering, Inc. ![]() Posts: 131 Joined: 8-February 06 Member No.: 4078 Using LabVIEW Since:2002 LV:8.20 ,8.0 ,7.1
|
3) You have to share the beer at the Gingerman Don't worry Dany - I'll step up and accept the award on your behalf Be sure to follow your own rule and share, Chris!
|
||
|
|
|||
Feb 2 2007, 07:13 PM
Post
#13
|
|
![]() I'm a LAVA, not a fighter. V I Engineering, Inc. ![]() Posts: 3740 Joined: 13-October 03 From: Michigan, USA Member No.: 181 Using LabVIEW Since:1993 LV:8.5 ,. ,.
My Blog
|