Start of trail Starting with a Blank VI navigation bar

Table of Contents >Quanser Rapid Control Prototyping Toolkit >Getting Started >Creating a New VI >

Using VI Templates

To facilitate creating new control systems, the RCP Toolkit supplies convenient templates. To use a template, simply select New... from the File menu. Then select one of the templates under the Template/Quanser/Rapid Control Prototyping Toolkit/Hardware category.

Basic Control Loop Template

For example, select the Basic Control Loop template, as illustrated below:

Selecting a template

Finally, click OK to open a new VI based on the template. A VI such as the one illustrated below will open:

Basic Control Loop

Now simply modify the VI to suit your application. In the case of the Basic Control Loop template, this might involve:

Basic Hardware Loop Template

Alternatively you can open the Basic Hardware Loop template under From Template/Quanser/Rapid Control Prototyping Toolkit/Hardware for a basic loop structure where the user is responsible for filling in the content.

Selecting a template

Finally, click OK to open a new VI based on the template. A VI such as the one illustrated below will open:

Basic Hardware Loop

Hint

Since a new VI is created from the template, the new VI may be saved without worrying about overwriting the original template.

Changing the Sample Time

To change how often the control algorithm executes, change the Step Size (s) parameter in the Configure Simulation Parameters dialog. The default is 0.002 seconds or 2 ms. Open the Configure Simulation Parameters dialog by double-clicking on the input to the CD&Sim loop or right-clicking on its border and selecting Configure Simulation Parameters from the context menu as shown:

Configure Simulation Parameters menu

The Step Size (s) parameter is depicted in the following figure. Its units are in seconds. Notice that the Auto Discrete Time option is checked so that the discrete step size is made equal to the continuous time step. Also observe that the Auto Period option is also selected on the Timing Parameter page to ensure the period is calculated to match the step size. Finally, the Synchronize Loop to Timing Source option is checked to make the loop run in real time. The default numerical solver is the Runge-Kutta 1 (Euler) solver.

Step Size parameter

 

navigation bar