Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents

Using LabVIEW in RT-LAB

Dynamic LabVIEW® Panels

...

RT-LAB automatically manages a user console built in Simulink®. It opens at the start of the simulation to display the desired signals and control parameters. RT-LAB also has a variable table in order to view and modify any data point at any moment. These  These data points can be visualized and manipulated from a LabVIEW user interface rather than from the Simulink user console.

Image Removed
Image Added
Image Removed
Image Added
Image Removed
Image AddedImage Modified

For inspiration and to show the possibilities of the tool, the following is an example of a user interface for a real-time small-scale micro-grid simulation built entirely in LabVIEW.Image Removed

...

 

Introduction & Getting Started

General Information

Users can configure LabVIEW panels to create visual interfaces in RT-LAB. Applications include, but are not limited to, test benches and machine-human interfaces.

  • Interact with your model in real time: Users can modify control signals; they can visualize acquisition signals.

  • Monitor your model: Users can quickly probe model signals.

  • Associate signals from your model: Users can drag and drop variables from the margins to appear in the console.

Users can also view signals through the LabVIEW GUI, and change parameters--but the parameters themselves remain unchanged in the original model: tweaks can be made for viewing on-the-fly, but these do not change the original compiled model.

LabVIEW panel templates are included with RT-LAB for your exploration, or your can build your own, either starting from scratch or by adapting existing ones.

RT-LAB supports LabVIEW panels in versions 11.1.3.56 and later.

The following LabVIEW versions are supported:

Image Removed

Refer to the installation guide for the supported versions of labVIEW: https://opal-rt.atlassian.net/wiki/spaces/PRD/pages/45878209/RT-LAB+Basic+Concepts+and+Compatibility#National-Instruments-LabVIEW-Compatibility

Software Required

  • To use existing panels: LabVIEW RunTime Engine (included with the RT-LAB MegaInstaller)

  • To edit panels: LabVIEW Base Development System (a LabVIEW license is required to edit panels)

See the RT-LAB Installation Guide for further information at this path:

<RT-LAB installation directory>\help\pdf\RT-LAB_IG.pdf

Image Removed
Image Added

LabVIEW Panels capability must be enabled in RT-LAB Preferences, see left.

NOTE: This capability should be enabled by default. You will only have to enable this capability if you are troubleshooting.

Launch the Preferences dialog shown to the left by navigating to Window > Preferences in RT-LAB.

 

Image Removed
Image Added

LabVIEW RunTime Engines are included in the RT-LAB installer, see left.

Make sure this check box is selected at installation time if you intend to use LabVIEW.

NOTE: This is enabled by default. You will only have to enable this capability if you are troubleshooting.

The screenshot to the left is from the RT-LAB MegaInstaller.


 

Adding LabVIEW Instrumentation/GUI to Your Model

Step 1: Ensure Your Model is Loadable & Add it

color
Background Color
Info
#D3D3D3

NOTE: This section is a very brief introduction to loading models in RT-LAB, and mostly out of scope for this document. For more on this step, please see RT-LAB’s Quick Start Guide.

  • Make sure your model is loadable by checking if the variables you’d like to use are in place in the left margin.

  • To receive real-time LabVIEW feedback, the model must be built/loadable on the target machine and the user must connect to it.

  • Variables are located in the collapsible Models folder in the left RT-LAB Project Explorer menu.

...

  • Expand the folders under Models to see if your variables are located there.

    • If they are not, then your model is not loadable.

    • Alternately, if you receive an error message starting Not compiled for…, this is another indicator that your model is not built.

      • To add a model to the RT-LAB project, right-click Models, then >Add.

      • To build your model, right-click Your model > Simulation, then >Build.

    • Expand the Model menu, and then expand the Subsystem menu. This is where you’ll find the signals and tunable parameters to add to your LabVIEW panel.

Step 2: Add Your Panel & Check LabVIEW Version

  • Right-click the Panels menu and choose New > Panel.

Add a new panel from a template, or…

Image Removed
Image Added


Import an existing RT-LAB panel.

Image Removed
Image Added

 

  • A New RT-LAB Panel dialog opens.

  • Choose the Name for the Panel.

 Image Modified

  • Select the latest LabVIEW Version you have installed.

  • Name your Project, or Browse… for a pre-existing project already named, and click Next.

Step 3: Select a Template & Add it

...

  • Choose one of the templates from the RT-LAB New Panel dialog, and click Finish.

  • Various layouts are available, but for the purposes of this documentation, choose the tutorial example

  • The RT-LAB LabVIEW interface appears.

color
Background Color
Info
#D3D3D3

NOTE: There are brief instructions in the LabVIEW Virtual Instrument (VI) itself, intended as helpful user prompts, for how to get up and running.

Image RemovedImage Added

  • At this point, and with the LabVIEW panel open, go back to your model and make a note of the signals from the model that you’d like to control, observe or interact with.

  • Using the rtdemo1 model as an example, we’ll take note of four areas we may want to measure, watch or interact with:

Step 4: Select Variables of Interest

...

The SM subsystem, above.

  • A: Output of the plant, whose signal is connected to the sensor response time block, B.

  • B: Sensor response time block.

  • C: The control from the actuator response time block.

  • D: Left of this, the control setpoint comes from the Adjust Reference slider block, below.

...

The SC (GUI/feedback) subsystem, above. 

  • Back in RT-LAB’s LabVIEW panel, select, then drag and drop signals from the Project Explorer to the left onto the various LabVIEW controls and indicators to connect them.

  • Ensure the variables you drag and drop on top the LabVIEW interface correspond to the items you’d like to measure, test or control.

  • When trying to measure a signal or feedback, users should trace the output desired to its parent node.

  • Using our example above, from the variable Adjust reference > Slider Gain > Gain > Signal 1, drag and drop the signal onto the graph at the right, as below. 

  • A reminder that RT-LAB output signals must be connected to LabVIEW indicators,

    while RT

    while RT-LAB control signals and parameters must be connected to LabVIEW controls, as described in Managing Connections below.

Step 5: Integrate Your Signals in RT-LAB’s LabVIEW Interface & Map Them

  • Add the same signal, A, to the graph by dragging and dropping it onto the graph.

  • As more than one signal can be simultaneously viewed in the graph, this is to be able to compare it to the plant response signal later.

  • A dialog box appears, Please select an index for SM-PID… Click Not Connected and OK to confirm.

  • Next, select the signal B (as in the screenshot above) from Sensor Response Time > Signal.

  • Drag and drop signal B onto the graph as well. You can now compare two signals on the graph at once.

  • Now load and execute the model by clicking the Play symbol.

  • A loading dialog appears, and the model is loaded.

Step 6: Run Your Model

  • The model is now running, and two lines appear, mapped in the graph box, corresponding to the two signals we have dragged and dropped there. The set point is in blue and the system response is in orange.

  • Click the slider to adjust the set point, and use the arrow to the right of the box to change the set point values.

Additional LabVIEW GUI Notes

...

In general, LabVIEW Controls act as inputs to the model and are typically knobs, buttons, dials, and sliders.

Image Removed
Image Added

LabVIEW Indicators display data and are typically graphs, charts, and LEDs

Image Removed
Image Added


Managing Connections


 Image Modified

In the screenshots above and below:

  • Control Signals (brown) are output from the console subsystem.

  • Parameters (dark blue) are values configured by double-clicking blocks in the master or slave subsystems.

  • Output Signals (light blue)are output by blocks in the master or slave subsystems.

Image Removed
Image Added

Connect Control Signals and Parameters to LabVIEW Controls, below.

Image Removed
Image Added

Connect Output Signals to LabVIEW Indicators, below.

Image Removed
Image Added
Image Removed
Image Added

Right-click a LabVIEW element to disconnect a connection.

 

Image Removed
Image Added

Hover over a LabVIEW element to view the connection path.