LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW DSC Module Panel Template Project

As mentioned in the Virtual User Group today for Power Programming with LabVIEW DSC here are the instructions and VIs for the Panel Template Example. Please not this requires LabVIEW DSC to be installed.

LabVIEW DSC Module GUI Template

This template will help you build robust, managable user interfaces for applications based on the DSC Module.  An event-driven model is used, but the template can be easily modified to use a polling-based approach without affecting the structure of the VI.

For every copy of the template made, you need to copy and rename the following VIs:
  • Panel Template.vi - the main GUI
  • Panel Template Data.ctl - a type definition to hold panel state data
  • Panel Template Event.ctl - a type definion enum for user events within the main GUI
Advantages:
  • Event driven GUI
  • Easy migration between event driven and polling-based modes, or a hybrid approach
  • Template takes care of most URL and connection management issues
  • Allows the user to eaily define GUI actions (set properties, invoke methods, etc) based on variable value changes
  • Integrated alarm monitoring
Running the template exmaple
  1. Deploy the "Sample Variables.lvlib"  This library contains several double-typed shared variables to test with.
  2. Run the Panel Template VI
  3. Modify Variable1...Variable3 on the front panel.  Change the base URL to '...\LibB' and repeat.
Implementing a polling-based GUI

This template is easily modified to use a polling-based model, or a hybrid polling & event based model.  This could be advantageous in applications with many variables that update very rapidly.  With a purely event-based model the GUI could be overwhealmed with variable events leading to slow response and high CPU usage.  A polling-based model offers linearly scaling CPU usage per variable count.

To implement a polling based model in the template, remove the Shared Variable Event Registration VIs.  Implement the timeout event case to periodically poll the generated list of variables.  Generate a user-event using the existing data change user event if the value has changed. 

A more robust and reliable implementation is to create one or more parallel while loops that polled the appropriate variables and post data change events to the event structure.  This would allow you to poll different groups of variables at different rates, yet use the same UI logic to update the panel.  This soluiton also offers more reliable timing.

Andy F.
-----------------------------------------------------------------
National Instruments
Message 1 of 3
(3,454 Views)
Hi Andy,

Maybe I have overseen it, but where is the download link for the VIs?

Regards

Ingo
0 Kudos
Message 2 of 3
(3,384 Views)
Here they are!

Andy


Message Edited by Andy F. on 06-03-2008 03:43 PM
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 3 of 3
(3,381 Views)