CASP Tutorial-6 Project

This tutorial demonstrates how to use existing FORTRAN code using user custom block.

Pre-Requisites

·         Tutorial-2 should be completed.

Model

·         In general user creates a wrapper block with suitable C++ code to interface with FORTRAN sub-routine.

·         For demo purpose ‘Fortran Demo’ block from /blocks/UserBlocks directory is used. The FORTRAN code in this demo does basic math operations based on user selection during block parameter configuration.

·         A sinusoidal signal generator is used along with an offset signal source. Both signals are added in FORTRAN code and result is displayed on plotter.

Step 1: Create New Project

·         Follow steps mentioned in Tutorial-2.

Step 2: Select Target Hardware

·         Follow steps mentioned in Tutorial-2.

Step 3: Creating Model

·         Create a model as shown in below figure.

       

·         Configure Data Merger block for 2 inputs and 1 output with output array size 2 as shown in below figure

·         Give names to slider and time plotter blocks as shown in below figure.

·         Set slider value range from 0 to 2 with step size of 0.1. Set initial condition of slider to 0 as explained in Tutorial-2.

·         Configure simulation panel and map slider and plotter blocks to simulation panel sub-windows as explained in Tutorial-2.

Step 4: Setup Simulation Parameters

·         Follow steps mentioned in Tutorial-2.

Step 5: 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.