ni.com is currently experiencing slowness/issues due to ongoing maintenance.
Support teams are actively working on the soonest resolution.
ni.com is currently experiencing slowness/issues due to ongoing maintenance.
Support teams are actively working on the soonest resolution.
03-16-2018 01:46 PM
Hi There,
Thank you for your time. We often have projects that require multiple sets of hardware, and therefore multiple sets of corresponding controls and indicators on the front panel. For example, we had a project that controlled 8 identical pneumatic cylinders, and each had its own position and force sensors. Each one of the 8 needed its own, identical, interface to control such things as the command signal, PID control parameters, data collection, and manual overrides. In another example, we had 3 identical Modbus devices, and each had its own data set. Each of the 3 needed 40+ front panel controls and indicators to read and write data. For each of these, we needed a way to edit the interface in one place, and automatically have it replicate.
Pneumatic
Modbus
For the pneumatic cylinder example, our approach was to use only 1 set of front panel objects. We gave the operator a control to select which of the 8 cylinders they wanted to control. This worked okay, but the downside was the block diagram messiness of loading and unloading data from the front panel objects. For the Modbus example, we just put the objects on separate tabs. I worked really hard getting the first one right, and then I put them all in a group, and copied them to the other two panels. This worked okay, but the downside will be making future changes.
I've also considered using property nodes to read the properties of the objects on one tab, and then writing them to the objects on the other tabs. The hard part is that I would want to read and write ALL the properties... position, representation, visibility, etc. Not sure there is a way to do this.
I've attached an example that represents the ideal. I've used a typdef'd cluster as a front panel. Then, when I change the typedef, all instances of it change at once. On the block diagram, I just put these into an array and use indexing in a FOR loop to keep the code identical. This looks like the answer we want, however, one downside is that all objects in the cluster must be either a control or an indicator, not a mix. Another downside is that there also doesn't seem to be a way to access the properties of the individual objects in the cluster. I've attached a simple example of this. This has got to be a very common issue with a clean solution by now. Looking forward to figuring this out!
Thank you!
03-16-2018 02:15 PM
You could look into using a Subpanel control to load a different instance of a reentrant VI. Here's info on a Subpanel:
http://zone.ni.com/reference/en-XX/help/371361P-01/lvhowto/loading_panel_in_subpanel/
When asynchronously running each instance of the VI, you'll need to pass in whatever inputs they need to be identified with a specific pneumatic cylinder.
Instead of a tab control, use a drop-down to load whatever VI instance at runtime.
03-16-2018 02:16 PM
1) Learn how to use sub-panels.
2) Modify your code for each widget such that all of the VIs are re-entrant.
3) Insert clones of the re-entrant VIs into each of the sub-panels possibly using a FP control of the clone to tell it which device it should talk to.
Done!
Ben
03-16-2018 05:13 PM
If you are going to go the sub-Panel, reentrant VI route (which is an excellent idea, one I've used many times), then I recommend the following:
Bob Schor
03-27-2018 08:16 AM
I tried the subpanels and have a couple questions. What is the procedure to center the controls in the subpanel? What is the procedure to exchange data between the main block diagram exchange data the subvi? See attachment with 3 methods: cluster, subpanel, and single front panel.
03-27-2018 12:48 PM
@andy_3141593 wrote:
I tried the subpanels and have a couple questions. What is the procedure to center the controls in the subpanel? What is the procedure to exchange data between the main block diagram exchange data the subvi? See attachment with 3 methods: cluster, subpanel, and single front panel.
03-27-2018 12:58 PM
You can even call it just like you would a normal SubVI with inputs and outputs using the Start and Wait on Asynchronous Call VIs.