To generate a Modelica model directly from the modeling tool  
  1. Right-click the Block TestCaseSignalProcessor::TestBed and select Tools Export to Modelica. Please see Generating a simulation file for more information. 
  2. Now make sure the OpenModelica Connection Editor (OMEdit) is installed:
    1. For Windows: https://openmodelica.org/download/download-windows
    2. For Mac: https://openmodelica.org/download/download-mac
  3. Launch OMEdit. Go to File > Open Model/Library File(s). Select the generated Modelica file located in the directory it has been saved in. It should be called SourceToSinkModel.mo.



  4. A SourceToSinkModel model will show up in the Libraries window. Double-click it. A tab called SourceToSinkModel should open up in the main OpenModelica window. Make sure it is in text view (by selecting the ‘note’ symbol under the SourceToSinkModel tab, as shown in the image below).



  5. Check that the model works by going to Simulation > Check Model. A Check Model pop-up box will show up and report on the success of whether the model is ready for simulation. Press OK.


  6. To setup the simulation run for the model, go to Simulation > Simulation Setup. Make sure the Start Time is 0 and the Stop Time is at 20 seconds (or any other reasonable amount of time, for this model 20 seconds should be enough). Press the Simulate button.



  7. Once the Simulate button is pressed, a pop-up window SourceToSinkModel Simulation Output will run until the simulation results are completed (indicated by a progress bar). OpenModelica will load up the Plotting Perspective (the Perspectives tab is in the bottom right corner of the image below) where the main window displays an empty graph and a Variable Browser shows up on the right.



  8. To see the input and output of the SourceToSinkModel, variables from the Variable Browser must be chosen. Selecting SourceToSinkModel > SourceToSink > inputSignal > y will display the input on the plotting window. Selecting SourceToSinkModel > SourceToSink > scopeSignal > output will display the simulation’s output on the plotting window.