Jump to content

Is it possible to create an Xnode that acts as a structure?


Recommended Posts

I've been playing around with Xnodes a lot, and I was wondering if it was possible to create an Xnode that can actually contain code inside of it. You know, like a loop or case structure. I know the timed structures' side terminal boxes are Xnodes, but the structure itself seems to be a primitive. (Don't know why they made them Xnodes if the whole thing isn't an Xnode.)

Is this at all possible? (I hope I'm posting this in the right section, as Xnodes and VI Scripting are very closely associated.)

Link to comment

I think you might be misunderstanding me.

You know the various structure node, like the while loop and case structure? They're basically nodes that can contain nodes. What I'm wondering is if it's possible to make new types of structures like those using Xnodes.

Link to comment

My understanding is the CDSM's diagrams are also first class citizens in LV. At the very least, they have their own special VI Server classes, both for the structure and for the diagram.

 

My guess would be that this is not possible using XNodes, but I can't say I looked into them deeply enough to provide a sound base for that guess. It's mainly a feel for how the system works.

 

Flarn, if you look through the structure classes and find an External Node class, don't get excited. That's the precursor to XNodes, and they were basically implemented as a flat sequence structure which held the actual code and was then minimized and hidden behind an icon. I don't think they will do what you want.

Link to comment
My understanding is the CDSM's diagrams are also first class citizens in LV. At the very least, they have their own special VI Server classes, both for the structure and for the diagram.

 

My guess would be that this is not possible using XNodes, but I can't say I looked into them deeply enough to provide a sound base for that guess. It's mainly a feel for how the system works.

 

Flarn, if you look through the structure classes and find an External Node class, don't get excited. That's the precursor to XNodes, and they were basically implemented as a flat sequence structure which held the actual code and was then minimized and hidden behind an icon. I don't think they will do what you want.

 

I know what external nodes are, but why would that get me excited?

And I'll take a look at SimX.xnode when I get a chance; thanks.

Link to comment

I don't think you could make an xnode that behaved like a structure without a lot of trouble.

One nutty idea would be an xnode that when dropped creates a sequence frame in its containing diagram and use that for your basic structure functionality.

 

Then if you can draw the xnode on top of the frame entirely without it looking terrible, I suppose you could intercept mouse interactions with the frame. Or maybe there is a way to get notification of when the frame is resized, moved, deleted etc and adapt appropriately. 

Link to comment

To the best of my knowledge, the answer is "no". We've had the XStructure on the drawing board for almost a decade but no one has gotten around to building it. There's minimal impetus to do so... the number of control structures that we've built into LabVIEW over the years has been fairly small -- they still fit in one palette. Very very few ideas are put forth that call for a new flow-control structure, so no one has felt compelled to build the G mechanism for defining one.

I suppose in theory you could build up an XNode that draws a very complex inner image and maintain all your own editor state operations for the fake diagram inside your node, but the work involved would be excessive in the extreme.

If you look at the Sim.xnode, I think you'll find a bunch of stuff that isn't actually implemented in G. I know, for example, that their whole interior is back in the C++ code. I don't know how extractable that layer is for a different XNode.

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