LabVIEW Robotics Module

Table of Contents

Simulator Assistant

  • Updated2023-02-21
  • 4 minute(s) read

Owning Palette: Simulator VIs

Requires: Robotics Module

Controls a robotics simulator and interacts with robot components. You can specify the sensors and actuators of a robot that you want to control in a simulation environment. The sensors and actuators you specify display as block diagram inputs and outputs.

You also can programmatically write VIs to control a simulation.

(Control Design and Simulation Module) By default, the Control Design and Simulation Module executes VIs and Express VIs as continuous functions. When you use the Simulator Assistant inside a Control & Simulation loop, you must execute the Simulator Assistant as a discrete function to ensure the Simulator Assistant and Control & Simulation loop are synchronized. Right-click the Simulator Assistant and select SubVI Node Setup from the shortcut menu to display the SubVI Node Setup dialog box. Select Discrete and configure the Discrete timing options to synchronize the Simulator Assistant and Control & Simulation loop.

Note  The Discrete timing options in the SubVI Node Setup dialog box specify timing in seconds. The Simulator Assistant dialog box options specify timing in milliseconds.

Right-click the Simulator Assistant and select Convert to SubVI to convert the Simulator Assistant to a subVI that contains the Simulator VIs used in the simulation.

Caution  You cannot revert the subVI you convert from the Simulator Assistant back to the Simulator Assistant.

Example

Dialog Box Options
Block Diagram Inputs
Block Diagram Outputs

Dialog Box Options

ParameterDescription
OverviewSpecifies the robotics simulator you want to control.
  • Simulation Scene—Specifies the predefined simulation scene you want to control. Select Browse to find and load a simulation scene from an existing manifest file.
SensorLists the available sensors and selected sensors.
  • Available sensors—Lists the sensors available for the robot.
  • Add Sensor—Adds the sensor you select in the Available sensors list to the list of Selected sensors.
  • Selected sensors—Lists the sensors you select to control.
  • Remove Sensor—Removes the sensor you select in the Selected sensors list from the list.
ActuatorLists the available actuators and selected actuators.
  • Available actuators—Lists the actuators available for the robot.
  • Add Actuator—Adds the actuator you select in the Available actuators list to the list of Selected actuators.
  • Selected actuators—Lists the actuators you select to control.
  • Remove Actuator—Removes the actuator you select in the Selected actuators list from the list.
PropertiesDisplays the properties of a sensor or actuator you select on the Sensor page or Actuator page, respectively. Click a property or its value in the Properties table to modify that value. When you manipulate a component in the Simulation View, LabVIEW automatically updates corresponding values in the Properties table. This table expresses values in SI units and SI-derived units.
Simulation ViewDisplays the simulation scene.
Device API PreviewDisplays documentation about the sensor or actuator you select in the Sensor or Actuator page. The documentation corresponds to a VI on the Simulator palette.

Block Diagram Inputs

ParameterDescription
StopStops the robotics simulator from running the current simulation instance.
sensorID.robotID.inputSpecifies the data parameter of the sensor you specify in Selected sensors, where sensorID is the name of the sensor and robotID is the name of the robot. The name of the sensor and robot is in the Properties table on the Sensor page. The data parameter corresponds to Data API in the Properties table on the Sensor page. If Data API has more than one parameter, this input is a cluster of all the parameters.
actuatorID.robotID.inputSpecifies the data parameter of the actuator you specify in Selected actuators, where actuatorID is the name of the actuator and robotID is the name of the robot. The name of the actuator and robot is in the Properties table on the Actuator page. The data parameter corresponds to Data API in the Properties table on the Actuator page. If Data API has more than one parameter, this input is a cluster of all the parameters.
3D picture refnumSpecifies a reference to a 3D picture control in which you want to display the simulation. You can wire a reference to a 3D picture control to this input to display the simulation scene on an existing front panel. By default, the simulator displays the simulation in a new window.
error inDescribes error conditions that occur before this node runs.

Block Diagram Outputs

ParameterDescription
sensorID.robotID.outputReturns the data parameter of the sensor you specify in Selected sensors, where sensorID is the name of the sensor and robotID is the name of the robot. The name of the sensor and robot is in the Properties table on the Sensor page. The data parameter corresponds to Data API in the Properties table on the Sensor page. If Data API has more than one parameter, this output is a cluster of all the parameters.
actuatorID.robotID.outputReturns the data parameter of the actuator you specify in Selected actuators, where actuatorID is the name of the actuator and robotID is the name of the robot. The name of the actuator and robot is in the Properties table on the Actuator page. The data parameter corresponds to Data API in the Properties table on the Actuator page. If Data API has more than one parameter, this output is a cluster of all the parameters.
DoneStops the simulation instance.
error outContains error information. This output provides standard error out functionality.

Example

Refer to the InvertPendulum.lvproj in the labview\examples\robotics\Simulator\InvertPendulum directory for an example of using the Simulator Assistant.

Log in to get a better experience