Setting Priority Of The Vi To Time Critical; Adding Timing To The Control Loop - NI LabVIEW Getting Started

Real-time module
Table of Contents

Advertisement

Setting Priority of the VI to Time Critical

Adding Timing to the Control Loop

Getting Started with the LabVIEW Real-Time Module
The VI reads analog data and sends the data to the PID VI. The PID VI
processes the data using a PID control algorithm. The VI returns the results
to the device. Refer to the LabVIEW PID Control Toolset User Manual for
information about using PID VIs.
(ETS)
Refer to the
examples\Real-Time\ETS\RT Control.llb
examples of control VIs.
To ensure determinism, you must assign time-critical priority to the control
loop VI. A VI set to time-critical priority receives enough processor
resources to complete time-critical tasks.
1.
Right-click the connector pane icon at the top right corner of the
VI and select VI Properties from the shortcut menu to open the
VI Properties dialog box.
2.
Select Execution from the Category pull-down menu.
3.
Select time critical priority (highest) from the Priority
pull-down menu.
4.
Click the OK button to set the priority.
Refer to Chapter 3, Building Deterministic Applications, of the LabVIEW
Real-Time Module User Manual for information about dividing and
prioritizing application tasks. Refer to the Priority Trouble VI in the
examples\Real-Time\RT Tutorial.llb
settings.
You must add a timing mechanism that pauses, or sleeps, the control VI to
ensure that other VIs in the application have enough processor resources to
complete. A time-critical VI that does not have any sleep time monopolizes
the embedded CPU resources. Refer to Chapter 3, Building Deterministic
Applications, of the LabVIEW Real-Time Module User Manual for
information about programming deterministic applications.
1.
Place the Wait Until Next ms Multiple VI in the control loop on the
block diagram.
2.
Right-click the millisecond multiple input of the Wait Until Next ms
Multiple VI and select Create»Constant from the shortcut menu.
3.
Enter
into the millisecond multiple constant. The timing
10
mechanism assures you that the control loop code runs and then sleeps
until the time equals 10 ms from the start of the iteration. Other VIs in
the application can run during the sleep time.
4.
Select File»Save As and save the VI as
First PID Control.vi
6
for an example of priority
for
.
ni.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the LabVIEW and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents