01-16-2008 06:37 PM
This is what I was hoping to do. I would define a parent class called signal that was really just an interface class. All of the child classes, analog in, analog out, digital in, etc. would have to override the VI’s in the signal class. So, the first thing that the program would do is to read a text file line by line, and on each line there would be a tag telling the program which type of signal to create. Next the newly created signal would be casted up to the parent class and put into an array. Once I have my array of signals, on the front panel I would have an array of text boxes. The text boxes would be displaying the names of the signals. In a search text box, the user can type some of the characters that are in the name of a signal, and the array would reduce the list until the user finds the signal they want. Here’s what I can’t figure out. I wanted the user to click a button next to the text box, that is listing the name of the signal they wanted, and the controls for that type of signal would appear to the right of the text box. How do I make the controls appear to the right of the text box? The controls are basically an indicator for reading an analog input or several controls that allow for ramping or stepping an analog output or setting a digital output or reading a digital input, etc. I’m hoping that the class can “make” the controls and indicators “appear” on the front panel. Any suggestions?
Thank you!
01-16-2008
08:00 PM
- last edited on
08-11-2025
09:30 AM
by
Content Cleaner
Do the controls and indicators you want to make appear depend on the type of signal child class created?
Your best bet is to use subpanels cleverly. Have a method in the parent called subpanel UI that you override in the child classes. In the overrided methods, put the controls and indicators that you want to display when a signal is selected. Then write some helper methods in the base class that make it very easy to insert a given child class's subpanel UI into the subpanel.
Finally, just put a subpanel in your top-level VI of your application next to the list with the signal types.
I've done this before and it worked really well. Let me know if this sounds promising.
Message Edited by Jarrod S. on 01-16-2008 08:04 PM
01-17-2008 11:49 AM
01-17-2008 05:50 PM - edited 01-17-2008 05:54 PM
01-21-2008 02:28 PM
01-21-2008 02:56 PM - edited 01-21-2008 03:00 PM
01-14-2009 03:14 PM
Hi
Sorry to wake up a one year old thread.
I tried to add a third child class to Jarrod's example but I get an error that I can't fix so far.
Basically in the project manager I created a child C.lvclass then I changed its inheritance to inherit from the parent class. I also created a Subpanel UI.VI from the default template and saved it in a child C folder.
The main vi gets a broken arrow because of the Subpanel UI.VI of the parent class.
I though I copied the connector terminals correctly but I have this error message on the Subpanel UI.VI of the child C class: " This VI doesn't match other VIs in the method, Connector Pane Terminal(s) are different. All VIs that implement a method of a LabVIEW class must match Connector Panes. To correct this, compare Connector Pane of both this VI and the VI of an ancestor class that implements this method. "
I don't get what is wrong. I may have created the the Subpanel UI.VI of the child C class in a different way than Jarrod.
I enclose Jarrod's example I'm trying to change.
Cheers
Charly
01-14-2009 03:19 PM - edited 01-14-2009 03:22 PM
01-15-2009 11:41 AM
Hi Charly,
I took at look at the ZIP file that you posted. The problem exists on the Connector Pane of the SubPanel UI.vi for Child C. As indicated in the error message you posted, the Connector Panes are not the same. In classes A & B, there is an additional input, a message queue. The Child C class VI does not have this input, so the connector pane does not match and the VI is broken. Hopefully this solves your issue!
01-15-2009 06:30 PM
Hi Stephen,
Good catch, unfortunately it doesn't fix the broken arrow. I also change the object connection to "dynamic dispatch inputs (required)"
Could you try to create a child on this project? There is something I'm missing and I don't get it.
Charly