
Figure 5. Block Diagram of the Test Ultrasonic Sensor VI
On the previous block diagram, the following VIs from the Starter Kit palette allow you to communicate
with the sensor and actuators connected to I/O on the Starter Kit robot. Although this VI is fairly simple,
the block diagram illustrates a common workflow for controlling RIO-based mobile robots.
•
The Initialize Starter Kit 2.0 (sbRIO-9632) VI begins a communication session with the FPGA on
the robot and returns a reference you use to read from or write to the FPGA.
•
The Write Sensor Servo Angle VI writes an angle to the servo on which the distance sensor is
mounted to turn the servo to that angle.
•
The Read PING))) Sensor Distance VI reads and returns the distance between the ultrasonic distance
sensor and the nearest obstacle the sensor detects.
•
The Close Starter Kit VI terminates the communication session with the FPGA on the Starter Kit
robot.
Tip
Select
Help»Show Context Help
to display the
Context Help
window, which displays
basic information about LabVIEW objects and the LabVIEW environment when you move the
cursor over each object.
These VIs and others from the Starter Kit palette allow you to control the Starter Kit FPGA from an RT
VI without writing an FPGA VI. To control a non-Starter Kit robot whose real-time controller contains
an FPGA target, you typically must write an FPGA VI that runs on the real-time controller and accesses
I/O. Figure 6 shows the block diagram for a simple RT VI that communicates with an FPGA VI to
perform the same task as the Test Ultrasonic Sensor VI.
Getting Started with the LabVIEW Robotics Module
10
ni.com