Jump to content

Connector pane


hepman

Recommended Posts

QUOTE (hepman @ Mar 31 2008, 09:30 PM)

Dear All,

is it somehow possible to find out with code if a terminal in a Sub-Vi Connector pane is connected or not.

Best Regards

Hepman

You can define your connectors as required, so you will get an error if this connector is not connected.

Link to comment

QUOTE (Aristos Queue @ Mar 31 2008, 08:32 PM)

No, it's not.

But it would be really really nice if it were. Sure the trick of using a 'null' default value works but I've done too many enums that go ["don't change","on","off"] to represent what ought to be naturally boolean data that I might want to change.

Actually, how about having an XNode that wraps the sub-vi calls and somehowpasses the connected term types into the sub-vi - trivially by the sub-vi having a 'special' terminal that is only used by the XNode to tell it which of the other terminals are wired. Perhaps there's a more elegant way thi can be done with tagging a reference to a contro on the subvi with the connection data. It's sort of cheating, but might do the trick.

Link to comment
  • 2 weeks later...

Marcel,

This looks good. I've modified the ConnectorPane_Core.vi to work when there is more than one subVI on the ConnectorPane_Wired_example.vi (it was throwing an error since you were closing the references too early).

You can see an example of the problem I had with this on the enclosed example. When there are more than one subVI with the same name on the example's block diagram, this doesn't work. I wonder if perhaps explicitly passing in the VI reference (instead of relying on the list of callers) to the core VI would solve this problem...

Link to comment

QUOTE (hepman @ Mar 31 2008, 08:30 PM)

Dear All,

is it somehow possible to find out with code if a terminal in a Sub-Vi Connector pane is connected or not.

Best Regards

Hepman

\

A trick I sometimes use is to set the default to zero or some other number that is useless to the Vi then test for it in the VI.

The assumption is that the caller would never send in a zero or a -99999999.000000001 etc..

I know it isn't perfect but it will get you moving on at least.

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.