jgcode Posted September 18, 2010 Report Share Posted September 18, 2010 Is there anything wrong with this code or is it just me? I think I am doing the same check however, with the GetLVClassDefaultValue.vi but it passes (but I expect it to fail). Thoughts? Quote Link to comment
Francois Normandin Posted September 18, 2010 Report Share Posted September 18, 2010 Hi Jon, You typecast from LVObject to LVObject, so I'd expect that you don't get an error for that with "To More Specific Class" prim. I suspect there would be a significant increase in overhead if this primitive were to dynamically check for the class hierarchy when it's fed with LVObject. It seems to me that this is like a using the code below: <a href="http://content.screencast.com/users/normandinf/folders/Jing/media/7a120e9c-2ed5-448a-973c-9971c69993b2/class%20typecast.png"><img'>http://content.screencast.com/users/normandinf/folders/Jing/media/7a120e9c-2ed5-448a-973c-9971c69993b2/class%20typecast.png"><img class="embeddedObject" src="http://content.screencast.com/users/normandinf/folders/Jing/media/7a120e9c-2ed5-448a-973c-9971c69993b2/class%20typecast.png" width="452" height="249" border="0" /></a> While the other case is clearly wrong as expected. In my opinion, this is not a bug in the behavior of the primitive but perhaps a bug in documentation? 1 Quote Link to comment
jgcode Posted September 18, 2010 Author Report Share Posted September 18, 2010 Hi Jon, You typecast from LVObject to LVObject, so I'd expect that you don't get an error for that with "To More Specific Class" prim. I suspect there would be a significant increase in overhead if this primitive were to dynamically check for the class hierarchy when it's fed with LVObject. It seems to me that this is like a using the code below: <a href="http://content.screencast.com/users/normandinf/folders/Jing/media/7a120e9c-2ed5-448a-973c-9971c69993b2/class%20typecast.png"><img'>http://content.screencast.com/users/normandinf/folders/Jing/media/7a120e9c-2ed5-448a-973c-9971c69993b2/class%20typecast.png"><img class="embeddedObject" src="http://content.screencast.com/users/normandinf/folders/Jing/media/7a120e9c-2ed5-448a-973c-9971c69993b2/class%20typecast.png" width="452" height="249" border="0" /></a> While the other case is clearly wrong as expected. In my opinion, this is not a bug in the behavior of the primitive but perhaps a bug in documentation? Thanks dude! I want to run script that finds any member in Project that is a Child of Parent by Name/Ref (not static - so I can't use the constant). Is there a better way to do this? - Given the above, I am thinking just looking at the Ancestor Paths for a match in path? Quote Link to comment
Daklu Posted September 18, 2010 Report Share Posted September 18, 2010 I think I am doing the same check however, with the GetLVClassDefaultValue.vi but it passes (but I expect it to fail). Like Francois said, the downcast prim is based on wire type, not object type. Try using the Preserve Run Time Class prim to get the behavior you expect. 1 Quote Link to comment
jgcode Posted September 18, 2010 Author Report Share Posted September 18, 2010 Like Francois said, the downcast prim is based on wire type, not object type. Try using the Preserve Run Time Class prim to get the behavior you expect. Quote Link to comment
Aristos Queue Posted September 18, 2010 Report Share Posted September 18, 2010 What Daklu said. Quote Link to comment
jgcode Posted September 18, 2010 Author Report Share Posted September 18, 2010 GDamnit, I suck Quote Link to comment
Aristos Queue Posted September 22, 2010 Report Share Posted September 22, 2010 GDamnit, I suck Hey! No taking G's name in vain! No wonder LabVIEW doesn't always work for you! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.