LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make a custom interface 'block'?

Hi all,

 

I'm usually interfacing a lot of sensors via compactDAQ modules. I've made some subVis to handle tasks such as applying calibration data or filtering to their signals. These calibration data typically need to be set up or changed on the fly, so defining all of the sensor calibrations in NI MAX would be rather painful (as far as I can tell).

 

My calibration subVis typically have a few controls (a table, some bools etc) whose interface I would like to define once and for all so it could be plopped down in a single action, instead of having to create new controls for every input of the subVIs, all of which have to be moved and organized. It  would be highly preferable if this could result in a single block in the block diagram, with multiple outputs...

0 Kudos
Message 1 of 5
(2,251 Views)
I am sorry I didn't get what is the problem you are facing? Can you please explain what do you are looking for?
-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 5
(2,233 Views)

Hi P@Anand.

 

I'm looking for the best practice for making a set of controls that interface with a subVI.

 

I have a customised subVI which I intend to re-use in many applications. What I want is to create a set of front panel controls  that I can also re-use.

 

I've been researching a bit on my own since posting my question, and am now looking into using a cluster for this purpose. This means passing a cluster to a subVI which I understand has its own challenges.. Any other suggestions would be appreciated.

 

 

0 Kudos
Message 3 of 5
(2,223 Views)
Cluster is a common and a good way to transfer data to sub VI. Even though there are many other way one more efficient way to transfer data is by having a Variant and a Enum inside a cluster. This will be efficient when you just want to pass data and don't wish to save them in nodes (shift registers). Using variant you can pass any type of data and the Enum will help you to identify the type of data.
-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 5
(2,215 Views)

A cluster makes sense for that situation. After you have created the cluster, make it a typedef. If you ever need to make any changes to the cluster or any constants you made from the cluster, you only need to change the typedef file and all the other instances will change automatically.

 

If you have some cases where the calibrations data remains constant over multiple reboots of the system, it may also be useful to save the values to configuration (or .ini) files. Look at the Configuration File VIs sub palette of th eFile palette.

 

Lynn

0 Kudos
Message 5 of 5
(2,207 Views)