05-02-2007 08:03 AM
I’m working with Labview 8.2 creating a control application. I’ve been working from the bottom up designing control functions for all the equipment I’m trying to control.
Each system has a Cluster as an input which is a type-def. This allowed each block to be written and tested. When each of these modules was complete, I took all the type-defs and bundled them into a cluster to make my application’s complete control cluster. See FlatPanel.vi attached. That’s worked fine and has allowed me to get things working as I learned the Labview basics.
I’m now looking for a little advice as to how to set up my final application. I think what I’d like to do is have a main while loop which only has the user interface control and a Control.vi. The control vi will do all the work. This structure will allow the application to be built, debugged and tested. After this I expect to get loads of feedback regarding the user-interface layout etc, this structure should allow me change the appearance without editing the control.vi and introducing new bugs. That’s my plan at least.
My question is this, what method should I use to for the interaction between the Control and the user interface? I need the control.vi to respond to the user interface but also to update it. For example, you might start a motor, with the user interface. The control section then detects that the motor is no longer required and switches it off, but how does it update the User interface?
I suspect that I should be passing the user interface to the control.vi by either reference or using notifiers, neither of which I’ve really used yet
Any ideas thoughts or advice would be appreciated.
Derek
05-03-2007 08:46 AM
05-05-2007 01:50 AM
05-07-2007 02:56 AM
Thanks to you both for replying.
I've not had much of a look at the events structure before the last day or so and that does seem to be helping simplify things.I'm treating all the Clusters indivdually in the GUI bundling them in to my Type-def cluster in the event handler, that's certainly helped. Didn't know you could create user events I'll look into that and keep you posted as to how I get on.
Thanks again.
Derek
05-07-2007 10:41 AM
I highly recommend that you pass the data to the user interface, rather than passing the user interface references to the control loop. Let the user interface worry about keeping itself up to date, rather than forcing the control loop to do it. This keeps your control loop readable (no references all the over the place), allows it to execute more predictably (no need to switch to the user interface thread), and makes it possible to move the control loop to a separate computer (or a real-time system) later without extensive rewrites.
@Dereklogitech wrote:I suspect that I should be passing the user interface to the control.vi by either reference or using notifiers, neither of which I’ve really used yet.