From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
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.
12-18-2019 03:02 AM - edited 12-18-2019 03:09 AM
@Darin.K wrote:
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.
Guess that depends on how you want to use the information. I think for example that the value\variant trick would work in executables, where the traversing won't. Not sure when I'd need that though... And if you prefer traversal gymnastics over variant gymnastics 😄
Nevertheless, neat trick. Wouldn't have expected that to work, and didn't cross my mind.
For reference:
12-19-2019 10:22 PM
Thank you Darren and Darin K.
i've managed to make the plugin to create accessors for DVRs. Works similar to how native "Create Accessor..." works. Plan is to post this on the plugin forum after few weeks of evaluation.
select data memebrs
create accessors (it also saves them automatically and even creates icon with text :))
www.xinstruments.com - Custom Software for Industrial Automation
www.hdrconverter.com - Picture processing made easy
12-19-2019 10:59 PM
A couple of quick points:
(1) As far as I know, the two error outputs on the IPES will always throw the same error, no need to string the inside one out and merge it.
(2) If you use Property Nodes for the accessors they will automagically accept class objects or DVRs. I am still so uptight that I insist on creating icons even if they will never see the light of day, so this tool could still be useful even in that scenario.
12-21-2019 01:09 AM
property nodes indeed accept DVRs of a class but not class with DVR unless you specifically code it to do so.
www.xinstruments.com - Custom Software for Industrial Automation
www.hdrconverter.com - Picture processing made easy