CASP Tutorial-2 Project

This tutorial project is extension of Tutorial-1 and additionally demonstrates the following

·         How to vary block parameters during simulation run time.

·         How to run simulation in real time.

Model

·         A signal generator with user specified wave shape is modelled and its output waveform is plotted.

·         Amplitude of signal generator is configured to be controlled at run time.

Step 1: Create New Project

·         Follow steps mentioned in Tutorial-1.

Step 2: Select Target Hardware

·         Follow steps mentioned in Tutorial-1.

Step 3: Creating Model

·         Create a model with a ‘Signal Generator’ and ‘Time Plotter’ and configure them as explained in Tutorial-1.

·         Set signal generator parameters such as wave shape, frequency and phase as desired and amplitude to 1.

·         Now let us try to change output amplitude of signal generator during run time. To achieve this, configure signal generator block parameter Basic->External Control->External Amplitude Control to ‘Yes’. Observe that an additional input port ‘a’ appears at bottom of signal generator block.

·         Add Slider block from block library to the model and connect it to input port ‘a’ of signal generator block. Name the block as ‘amp_ctrl’.

·         Configure slider block parameters as shown below

Step 4: Configure Simulation Panel

·         Configure simulation panel to add ‘Plot Display’ in SubWindow1 and ‘Control/Meter’ in SubWindow2.

·         After configuring simulation panel add ‘plotter‘ block to simulation panel Group1->SubWindow1 and ‘amp_ctrl’ block to Group1->SubWindow2.

·         Configure initial value of slider block to 0.5 by right clicking on the slider block and selecting ‘Edit Initial Condition’.

Step 5: Setup Simulation Parameters

·         Configure following simulation parameters as shown below figure. Note that in below figure following parameters are set

§  Simulate for limited time is set to No to make simulation time unlimited.

§  Simulation Speed Factor to 1 to make simulation real time.

·         Leave rest of the parameters to default.

Step 6: Run Simulation

·         Press Build/Run button from Home->Simulation menu item. CASP builds and compiles the model and opens separate simulation panel window. In the simulation panel window press ‘Run Simulation’ button to run simulation. The output of simulation is shown below.

 

·         Above simulation will run in real time. User can change the amplitude by varying the slider value.