Need Help? E-Mail Tech Support your Questions: support@xanalog.com If you haven’t already, you can get your own free copy of NL-SIM and MML. Part 5 can be found here. To get a feel for the NL-SIM’s mechanics, let’s begin by building a simple model and running it. - To start a new model, click on Edit from the Model menu (or just press F3)
- In the Name: box, replace the current entry with the name of your model; call it demo1.
- A New Model Metaphor window opens allowing you to choose between a Picture model (Block Diagram), an Algorithm model (Text), or a C Language Routine; choose Picture and click OK.
- A blank block model window will appear. Maximize the window.
- Click on the import icon and then move your mouse pointer into the blank area of the block diagram (you don’t need to hold the mouse button down while dragging)
- Click in the center of the empty block diagram to create an import block. The Import Setup Dialog window will now appear:
- Change the Name: box from “import” to SineWave
- Click on the sine wave icon
inside the import setup window to select a sine wave. Note the word “Sine” appears just above “Amplitude”. - Change Both the Amplitude: and the Period: values to 1. The import Setup window should now look like this:
- Click on OK to return to the block model window.
- Now, create to an export block in your model. Click on the export icon
and place the mouse so that its to the right of the Sine import block (remember you don’t need to hold the mouse button down while you drag). - Click again to drop the export icon, thus creating an export block. An Export Setup dialog window now appears to allow you to name the export block.
- Change the block name to Sine_out, then click OK to return to the block model window. (Note: Notice that the name you’ve entered for the export block is too long to fit within the block. However, if you move the mouse pointer over the export block you will notice that its full name Sine_out appears.)
- Now it’s time to connect the blocks together into a simple model by specifying the data flow (signal flow) between the blocks. Move the mouse to the right side of the SineWave (import) block. The block perimeter changes color to green and a connection point appears.
- Click on the connection point; a data flow line appears.
- Drag the data flow line until it reaches the Sine_out(export) block. Notice that the block perimeter changes to green and aconnection point appears.
- Click on the output block connect point to complete the data flow (or signal) connection. You model should look something like this:
- To run the model, you must first load it. Select Load from the Model menu (or just press F4). The trace-tree window appears with the name of your model in the header panel.
- Using the right mouse button, click on the purple “leaf” icon in the upper left hand corner of the window. Your block model will now appear.
- Click on the Sine_out block and a dotted line appears around the block. You have just selected this particular block’s output for display.
- Now Select Time Plots from the the Display menu (or Press Alt-F6) A time plot window opens in the upper left corner. Grab the lower-right corner of the window with the mouse and drag it down and to the right so you screen looks like this:
When a Time Plot Window Opens, a single set of up and down arrows is visible at the left lower corner. These are used to increase and decrease the time scale of the plot. As a default, vertical scaling is automatic. Each time the plot completes a traverse of the plot window, the system automatically calculates a vertical scaling update for the plot. - Manual vertical scaling is optionally availabl. To invoke manual scaling, double-click in the white grid area of the plot. A second pair of up and down arrows now appear which can be used to manually scale the dependent variable. Now the plot is always scaled according to the manual setting until the user chooses to change it.
- To return to automatic scaling double-click a second time in the white grid area; the second pair of up and down arrows disappears and vertical scaling is now automatic again.
There are two ways to run a model. You can press F9, which runs your model until its specified completion time (or indefinately, without stopping, if this is your choice). Alternatively, you can activate single-stepping by selecting Single Step from the Model menu. - Press F8 once or twice and notice that the numerical values in the SineWave and sine_out blocks change. With single-step mode, you can observe your model’s behavior in small increments. Single Step mode is particularly useful when you want to observe your model’s behavior as it approaches a critical point or if its unstable.
- Select Clock from the Display Menu. This will show you when the model is running.
- Select Run/Display Times from the Setup menu (or press F7). Click in the Run indefinitely box in the Run/Display Times dialog window and click on OK. Run the model by pressing F9.
- Stop the run by pressing the Pause/Break key.
- Now you have a clipped sine wave in the plot window. Why is the sine wave so crude? It’s because you’re not using enough samples. Select Run/Display Times from the Setup menu (or press F7) to bring up the Run/Display Time dialog window.
- Change the Display Update Interval value from 0.1 to 0.01, then click OK.
- You are able to increase the update interval because the model is setup to compute every 0.01 seconds.
- To see these intial setup parameters, select Alter Mode Parameters from the Setup menu, click on xacont (continuous mode) in the Model Modes box, and then view the contents of the Integration Interval box. Click on OK to return to the Block Diagram.
- Press F9 to begin running the model again. You now see a smoother waveform as shown below:
CONGRATULATIONS You have completed the NL-SIM Getting Started Guides Part Four of of Seven Continue on to Part 5 |