Will Toth Posted May 4, 2014 Report Share Posted May 4, 2014 I am trying to create a simple tree data structure using DRVs. I created a typedef cluster with the following elements: Int (node's data) Array of this typedef cluster (child nodes) My plan here is to save the head node, and be able to iterate through the tree via the child node array. However I cannot dynamically build and assign an array of nodes, I can only add a static array. The following image shows the error that I get. Any ideas why this would give me an error? Thanks Quote Link to comment
ThomasGutzler Posted May 4, 2014 Report Share Posted May 4, 2014 (edited) LabVIEW is too clever to let you do that, but there's a trick: Edited May 4, 2014 by ThomasGutzler 2 Quote Link to comment
Mellroth Posted May 5, 2014 Report Share Posted May 5, 2014 LabVIEW is too clever to let you do that, but there's a trick: It is neat, but I would cast and store a Data Log refnum instead. That way I believe you'll get a cast that will work regardless if the DVR is in a 32- or 64 bit environment. You'll also be able to better detect bad wiring because of the strict type of the Data Log Refnum /J Quote Link to comment
mje Posted May 6, 2014 Report Share Posted May 6, 2014 Refnums are not pointers. The size of their values (four bytes) doesn't depend on architecture. Either way I'm surprised you were even able to declare the original recursive type definition. I'm aware an empty array is not actually recursive, but usually LabVIEW errs on the side of caution and strictly prohibits anything of the sort. I'm inclined to think your ability to declare the type at all may be a bug. 1 Quote Link to comment
Mellroth Posted May 6, 2014 Report Share Posted May 6, 2014 Thanks for the reminder. I'll still stick to the DataLog Refnum due to type checking /J 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.