Jump to content

Event Structure Selector Labels


Recommended Posts

That wouldn't help you because the reference you get is for a diagram, which wouldn't have the specific info you need from the event structure. It looks like nothing at all about the event structure is exposed in the scripting API - there's no way to get the event structure data, there's no method for registering events, etc. Even the Register for Events doesn't appear in the New VI Object list. I'm assuming that means NI will need to do some work to expose it.

  • Like 1
Link to comment

I wanted to be able to right click a control or terminal and have it look up if it's attached to a case in an Event Structure and display that case.

What you can do is get all frames, then for each frame get all objects, cast all objects to Control Terminal ref and keep the refs that do cast and get the terminal label text. Now you have a list of terminal refs against frame refs by terminal label text. If you search for your control by label text you can get its Terminal ref and also the ref of the frame that it belongs to.

Link to comment

What you can do is get all frames, then for each frame get all objects, cast all objects to Control Terminal ref and keep the refs that do cast and get the terminal label text. Now you have a list of terminal refs against frame refs by terminal label text. If you search for your control by label text you can get its Terminal ref and also the ref of the frame that it belongs to.

I guess I should have explained why I'm building the plugin.

If the terminal is in the Event Frame, you can just double click the control and it will bring you to the correct Event Frame. Don't need a plugin for that. And if you're already looking at it in the code, you're already there as well.

Sometimes the terminal is not in the Event Frame it's linked to, and that's was going to be the real purpose of this plugin. Say you double click a control and it gets highlighted in the code, but it's not in the Event Structure, but you know there's an Event configured for it. You can now right click the terminal and select "Find Event Case" and automagically you're looking at the correct Event Frame.

If I'm reading what you're suggesting correctly, it will only work if the terminal is in its Event Frame. Good solution if that use case will work for you though.

Thanks

Link to comment

If I'm reading what you're suggesting correctly, it will only work if the terminal is in its Event Frame. Good solution if that use case will work for you though.

Thanks

Ahh, true, but I agree not much use for what you want to do.

I had a bit more of a play now understanding what you want to do and I can't get the user event case names attached to a particular terminal either. Yair is right, doesn't look like its exposed.

Link to comment

Sometimes the terminal is not in the Event Frame it's linked to, and that's was going to be the real purpose of this plugin. Say you double click a control and it gets highlighted in the code, but it's not in the Event Structure, but you know there's an Event configured for it. You can now right click the terminal and select "Find Event Case" and automagically you're looking at the correct Event Frame.

Better would be even if that menu was in the front panel too and of course disabled for controls that do not have an event associated. :D

But for now this is something only NI can do in their LabVIEW C(++) code. :wacko:

Rolf Kalbermatter

Link to comment

Better would be even if that menu was in the front panel too and of course disabled for controls that do not have an event associated. biggrin.gif

But for now this is something only NI can do in their LabVIEW C(++) code. wacko.gif

Rolf Kalbermatter

That was part of it as well. thumbup1.gif

I already had the Initialization code done when I realized I couldn't get the "TextLables" property for an Event Straucture. It looks to make sure that the selected item is either a panel control OR a diagram terminal AND that there's an Event Structure or the menu won't show. I like the idea doing the search at this stage so the menu only shows if there's a linked Event Frame.

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.