Documentation Home Page ◇ RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
LabVIEW Documentation | RT-LAB v.11.3.x and up
Using LabVIEW in RT-LAB
Dynamic LabVIEW® Panels
Through the RT-LAB interface, users can open LabVIEW® panels containing LabVIEW controls and indicators. Signals from the model can be dynamically assigned to these elements through drag-and-drop, even while the simulation is running. Users can create control panels made of gauges, dials, scopes and virtual instruments.
Easy-to-Tune Simulation Parameters
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 data points can be visualized and manipulated from a LabVIEW user interface rather than from the Simulink user console.
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.
Introduction & Getting StartedGeneral 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. | |
| |
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. 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
See the RT-LAB Installation Guide for further information at this path: <RT-LAB installation directory>\help\pdf\RT-LAB_IG.pdf | |
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.
| |
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
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… | Import an existing RT-LAB panel.
|
|
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.
NOTE: There are brief instructions in the LabVIEW Virtual Instrument (VI) itself, intended as helpful user prompts, for how to get up and running.
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-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
Changing Viewing Scale for Variables
At any point, you can increase or decrease the time scale of the graph for observation by clicking a numerical value on the Time (X) axis and changing it, then click Enter.
This does not change the underlying data, but the speed at which it is being run and observed.
If you change the uppermost value of Time from 10 to 100 seconds, for example, the display auto-scales to reflect this change.
LabVIEW Controls & Indicators
In general, LabVIEW Controls act as inputs to the model and are typically knobs, buttons, dials, and sliders.
LabVIEW Indicators display data and are typically graphs, charts, and LEDs
Managing Connections
| |
In the screenshots above and below:
| |
Connect Control Signals and Parameters to LabVIEW Controls, below. | |
Connect Output Signals to LabVIEW Indicators, below. | |
Right-click a LabVIEW element to disconnect a connection.
| |
Hover over a LabVIEW element to view the connection path. |
OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter