LabVIEW Shortcut Menu Plug-Ins

cancel
Showing results for 
Search instead for 
Did you mean: 

Create Event.llb

Author: Darren (NI)

 

Note: This plugin is included in LabVIEW 2018 and later. You only need to download and install it from here if you are using LabVIEW 2017 or previous.

 

Adds a new Create > Event Case pull-right on controls and control terminals:

ev1.png

 

Selecting this option creates a new Event Case configured for the specified event on the control:

ev2.png

 

Some additional notes:

  • The menu only appears if there is exactly one event structure already on the diagram. It appears on controls and control terminals. It does not support multi-select.
  • If the control terminal is unwired, and not already placed within another event frame for that control, it will be moved into the new frame. The terminal will not be moved if an event is being configured for a nested control (i.e. a control within a cluster).
  • The Event Data Node is shrunk to a single element and moved to the lower corner.
  • Class-specific events are shown in the list...for example, if you right-click on a Tree control, you'll see the Item Open, Item Close, etc. events in addition to the standard Control events.
  • The menu does not appear on indicators.
  • If the specified event already exists for the control, the event structure will be switched to that existing frame and highlighted.

 

Attachement is saved in LabVIEW 2015. For install instructions, go here.

Comments
Neil.Pate
Active Participant Active Participant
Active Participant
on

Works exactly as expected.

It automatically moved the control inside the event case, which I was not expecting (but pleasantly surprised).

My only two suggestions for increased UX would be that the event data unbundler could be in the middle of the left-hand side of the event structure, and the control itself could be better placed. These only take a few seconds to fix though, so all-in-all I am very happy with this plugin.

Create Event.PNG

X.
Trusted Enthusiast
Trusted Enthusiast
on

I have used this shortcut quite a while now, and I must say that contrary to Neil.Pate, I am not pleased with the "bonus" action of dropping the terminal in the event case.

The reason is that I am grouping my terminals in an unused case structure where they are organized in logical groups (e.g. tabs they are located in or function), and the last thing I want to have to do is to bring them back there from the Event case where they were just moved.

Moreover, while I could see the logic of dropping the terminal in the event case for a "Value Change" event (and only for a latchable Boolean really), I can't fathom the need to get the terminal in the case when selecting, say, the shortcut menu activation event.

The workaround I have found is to connect those unused terminals to a sequence structure (again, this is never executed), which prevents the shortcut to move those terminals.

But fundamentally, I question the need of this supernumerary action. The shortcut is about "Create Event", not "Create Event & Drop Terminal if it is unused" after all...

My 2 cts.

Hooovahh
Proven Zealot Proven Zealot
Proven Zealot
on

I understand that opinion, and see it as a valid case.  I'd recommend using the shift modifier, and choose to not move the control, if shift was held when the quick drop command was called.  Personally I'd say the majority of the time that an event structure case is called, the control for it is in that case, but like you said maybe that is because button value changes are the most common event type.

kosist90
Active Participant
Active Participant
on

Great plugin!
I'd agree with the first suggestion - to move controls a bit more out from corner, because of Event structure grows when label is positioned left-sided.
Also, maybe it would be nice to extend it to have option to create duplicated event case for the selected control. It would give list of events to duplicate, and move control to that event case structure.

kosist90
Active Participant
Active Participant
on

Would it be possible to update plugin in a way, that it'll generate single event for multiple selected controls of the same type? I mean, when someone needs to have one event page for several controls?

Darren
Proven Zealot
Proven Zealot
on

That should be possible. If you want to take a stab at updating the plugin with this functionality and posting back here, we can look at adding that functionality to the shipping plugin in a future LabVIEW release.

kosist90
Active Participant
Active Participant
on

Ok, thank you - I'll give it a try then ))

北京铁路信号有限
Member
Member
on

It doesn't work as expected. 

I created a boolean control and an event structure. When I use shortcut to create Boolean button value to change the event structure, it created a value changed event structure and  move the boolean button to the event structure . Then, the value changed event structure will disappear automatically, and the boolean button will return to the previous position. For me, it's an invalid operation.

 

I try to resole the problem but I could not do ti .  Please help me .

Thank you.

 

 

Darren
Proven Zealot
Proven Zealot
on

When that happens it's because an error occurred in the scripting. When an error occurs, we rollback the operation, which is why you see the code get scripted, but then go back to the previous state. Is there a chance you could post a VI that demonstrates the issue to this thread?

北京铁路信号有限
Member
Member
on
Oh,I think I don't how to do, do I need to write a VI.llb like Create Event.llb? ‏ What do I implement this VI to demonstrate this issue?
Darren
Proven Zealot
Proven Zealot
on

If you have a VI where you right-click on a control to create an event, and the creation fails in the way you describe, please post that VI so we can see why the scripting doesn't work on your VI, but it works on our VIs.

北京铁路信号有限
Member
Member
on

OK, I got it .

I have tried to give the VI to my colleagues, which is so easy just a bool and an event structure ,like the picture. And this function can be normally implemented on their computer.Demo.png

Darren
Proven Zealot
Proven Zealot
on

So it sounds like something particular to your LabVIEW installation is causing problems. Here are a few things you can try to isolate what is different about your LabVIEW:

 

1. Close LabVIEW, rename your LabVIEW.ini file to LabVIEW.bak, and restart LabVIEW.

2. Close LabVIEW, rename [Users]\Documents\LabVIEW Data to LabVIEW Data_bak and restart LabVIEW.

 

See if either of those causes the issue to go away. Then you can further troubleshoot from there to try to identify the offending INI token or LabVIEW Data file.

北京铁路信号有限
Member
Member
on

I tried to two methods,but it still failed.😓

User002
Not applicable
on

I experienced the same problem, where the event case gets created but immediately disappears again.

 

In my case the issue seemes to be related to the 'JKI Flat UI Controls 2' package. Uninstalling the package fixes the issue.

 

As I'd like to use the shortcut as well as the Flat Controls, any ideas how to make both work together would be greatly appreciated.

 

Thanks!

Darren
Proven Zealot
Proven Zealot
on

Thanks for the additional info. I was able to reproduce the problem when the JKI Flat UI Controls package is installed. Unfortunately, I think this problem is happening because of a bug in the right-click framework itself. The bug I'm referring to is fixed in LabVIEW 2020, and it looks like this right-click plugin (which is already included in 2020) works properly, even with the JKI Flat UI Controls package installed.

 

So the only workarounds I know of are to either upgrade to LabVIEW 2020, or uninstall the JKI Flat UI Controls package in LabVIEW 2015 through 2019. Let me know if you are able to find another workaround.

User002
Not applicable
on

You're right! The bug you mentioned really turns out to be the cause of the problem.

 

Luckily a patch was posted earlier this year which fixes this issue in LV2015 - LV2019 by replacing a single VI in the resource folder:

https://forums.ni.com/t5/LabVIEW-Shortcut-Menu-Plug-Ins/Bug-Fix-for-ALL-Right-Click-Menu-Plug-Ins-LV...

 

I've applied the patch today (running LV2018), reinstalled the JKI package and so far everything works like a charm.

 

Thank you for your help!

北京铁路信号有限
Member
Member
on

OK, I get it .And it works well.

Thanks!

yangmumu
Member
Member
on

发现Bug,labview17sp1 、visa control 、Create > Event Case、Enter after deleting content 、labview Auto Close 🙄

Contributors