Jump to content

Typedefs, Xnodes, and a Dwarning


jdsommer

Recommended Posts

I've spent two weeks banging my head against this problem and finally found the solution. I thought I'd post it here for posterity.

 

I have a set of xnodes (in the Live HDF5 toolkit) which are based off of the common use-template-VI-to-generate-diagram-code paradigm. I recently added a number of typedefs into the template VIs. After doing so, when placing or editing the xnodes, I received the following dwarning

 

Internal warning 0x0 : "xstuffprivate.cpp", line 2211

LabVIEW Version 11.0.1

 

but only for certain typedefs. The warnings occurred after GetTerms was called and before AdaptToInputs. (Note that DWarns normally only show during the *next* launch of LabVIEW, but with appropriate .ini magic they can be made to appear immediately.)

 

A second effect is that, while the xnode generates mostly correctly, the terminal in question does not become a typedef, but a matching type that is not typedefed (U16 enum, in my case, with all the right items).

 

This sent me on a long goose chase trying to figure out why some typedefs worked, and others didn't. It turns out, that the typedefs that worked were being used somewhere in my xnode ability VIs, while the ones that did not work were only used on the template VIs, but not in the xnode ability VIs. I dropped a typedef constant of the otherwise-unused-in-ability-VI typedef into my GetTerms ability VI, and voila, the DWarns stopped appearing. Problem solved.

 

Analysis: I think we know that ability VIs run in a different instance of LabVIEW from the one into which the xnodes are dropped. I don't hold open a reference to my template VI throughout the ability VIs. (IIRC, I tried this and had numerous problems.) I open it for Initialize to find the term info which is shoved into State.ctl. When GetTerms is called, I simply get the terms from State.ctl and return them to the output. I open the template again in GenerateCode.vi. Therefore, there may be no reason for the xnode instance of LabVIEW to have my typedefs open in memory at the point that GetTerms is called. By placing the typedef into GetTerms we force LabVIEW to have it open and solve the problem.

 

Here's hoping this helps someone else in the future!

Jason

  • 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
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.