Developer Center Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to set the linked palette for block diagram functions?

Solved!
Go to solution

I'm sure everyone is familiar with LabVIEW's ability to the related palette when you right click on a block diagram function or terminal, right? For example, drop an Equal? primitive down and then right click it, you see the Comparison Palette and Boolean Palette are ready in the menu. Or drop Basic Function Generator.vi and right click, and LabVIEW provides quick access to the Waveform Generation Palette.

I have a toolkit which incorporates some XControls. When dropped onto the front panel, the terminal is of the datatype used in the XControl. This happens to be a custom datatype for my toolkit, which is a Data Value Reference pointing to a custom class. Now, when I right click my terminal I get immediate access to the Memory Control Palette (which is where one would handle Data Value References) - but this is exactly the opposite of what I want! I want the developers of my toolkit to be able to access the various VIs I provide to handle the DVR sensibly. Therefore this needs to point to my own palette of VIs that are distributed with the toolkit.

So, how do we configure this? Is it automatic? How does LabVIEW go about determining which palettes are associated with VIs, functions and custom datatypes?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 1 of 15
(9,497 Views)

In a class (or a library), you can select the default palette in the properties (on Page General) after the menu file (.mnu) is added to the class. This palette is shown when rightclicking on a wire of the class.

But the palette is not shown for DVR containing the class.

Default Palette Demo.png

Could maybe the XControl return the class which contains the data in a DVR?

Message 2 of 15
(6,127 Views)

shb wrote:

In a class (or a library), you can select the default palette in the properties (on Page General) after the menu file (.mnu) is added to the class. This palette is shown when rightclicking on a wire of the class.

But the palette is not shown for DVR containing the class.

Default Palette Demo.png

Could maybe the XControl return the class which contains the data in a DVR?

The common datatype used throughout the toolkit is the DVR, the content itself is sensitive and ideally wouldn't be handled by the developer, so I must always use the DVR for the XControl datatype.

If using DVR always causes the memory palette to be shown, am I therefore stuck here?

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 3 of 15
(6,127 Views)

Why don't you wrap your DVR in a class?

This way you can also control access to your DVR reference or do your users need direct access to the DVR?

Message 4 of 15
(6,127 Views)

Karsten van Zwol wrote:

Why don't you wrap your DVR in a class?

This way you can also control access to your DVR reference or do your users need direct access to the DVR?

Is that also what you were suggested shb?

It's an interesting thought, a class wrapping a DVR of my class...

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 5 of 15
(6,127 Views)

Thoric,

I was going to suggest the same thing, wrap your DVR in a class. This has also the added benefit that if for whatever reason you ever change your mind about using a DVR it won't break your users code, because they would have been using the object it also does not give them the temptation to attempt to wire that DVR into a in place structure.

Regards,

Fab

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
Message 6 of 15
(6,127 Views)

Thoric,

As I know, you could create a library (.lvlib) file, add all your VIs and the palette (.mnu) file to this library then set the default palette as the palette file you added.

DefaultPalette.png

Message 7 of 15
(6,127 Views)

Plenty to think about here. Thank you everyone for all your contributions!

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 8 of 15
(6,127 Views)

There's no way to get this to work for the wire type. Since you can't do operations directly on the DVR for any of the types inside the DVR, the DVR doesn't automatically display its contained type's palette. We've never added a second palette to the LV class to specify "this is the palette to show if I am inside a DVR".

Message 9 of 15
(6,127 Views)

Thanks Aristos.

I think, based on Fab's sensible maintainability advice, I will be moving to using a further custom class used purely for containing the DVR in it's private data, create a bunch of wrapper calls to the existing methods, and take advantage of the 'default palette' feature of the class library settings.

My only issue at the moment is that I use VIPM to build and install my palette for me, therefore it doesn't exist in my development environment and it's not available for selection. I can't install the toolkit into my dev env, that would be a cross-linking nightmare, so now I'm learning to create my own palettes, which is a little less fun that I'd hoped.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 10 of 15
(6,127 Views)