Jump to content

Tree Data Structure with DVR Arrays


Recommended Posts

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.

 

post-51329-0-48114200-1399236434.png

 

Any ideas why this would give me an error?

 

Thanks

Link to comment
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

Link to comment

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.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.