12-16-2019 02:16 PM
I want to create a script which creates accessors for DVRs. One of the issues which i have is the need to navigate to cluster of the private data. Then i can right click it and create required VIs using my plugin (DVR helper). It works similar to built in Labview feature "Create Accessors..."
I wonder if there is a way to use plugin from the project window by simply right clicking on a class. Similar to how GOOP and LUT plugins work (see images below).
So the question is: how to add custom menus to the right lick action in the project window?
www.xinstruments.com - Custom Software for Industrial Automation
www.hdrconverter.com - Picture processing made easy
Solved! Go to Solution.
12-16-2019 02:32 PM
You have to write a project provider:
In my opinion, project providers are more trouble than they're worth. I don't recommend pursuing this path. Instead, consider providing your utilities in the LabVIEW pull-down menus. I discuss this topic and more in the following presentation: http://bit.ly/dnattlvhooks
12-16-2019 02:35 PM
Yes, currently you need to use the Project Provider Framework. Start here: https://forums.ni.com/t5/LabVIEW-Project-Providers/gp-p/bymqyodmkc?profile.language=en.
It is a little involved but doable if you have the motivation. It does come with a caveat of "it might break something" but has been used extensively enough that the community has enough experience to point out the pitfalls.
12-16-2019 06:40 PM
thank you.
Another question: is there a way to get references to the controls contained within DVR?
Currently i have a cluster control called data (for each class i use) from which i create DVR. When i right click on DVR i search for the Data.ctl and obtain references to it's components. Then i create all user selected accessors to the components of this cluster. Is it possible to get references to controls contained in DVR without having a specific ctl file converted into it?
www.xinstruments.com - Custom Software for Industrial Automation
www.hdrconverter.com - Picture processing made easy
12-17-2019 09:19 AM
@AlexanderKhodarev wrote:
thank you.
Is it possible to get references to controls contained in DVR without having a specific ctl file converted into it?
I don't think you can get references to individual elements. The Element property returns an error when getting the value. This makes sense, but it prevents us from getting the data type of the element.
You can get\set the element as one. Get the value of the reference, and then use NI_Data Type.lvlib:Get Refnum Information.vi to get information about the variant.
12-17-2019 10:36 AM
wiebe@CARYA wrote:
You can get\set the element as one. Get the value of the reference, and then use NI_Data Type.lvlib:Get Refnum Information.vi to get information about the variant.
Personally I would traverse instead of doing the variant gymnastics.