Main Operator using Ansys SCADE Software — Lesson 4

To connect the PWM with the Control operators we should create a new operator, named “Main”. This will have three inputs, just like the PWM one, as those three will be directly passed to it, and a single output, the one resulting from the Control operator. With a few simple clicks as described previously, we can have the final and central operator.

The main operator should also be a Node Operator as it includes the Control one. Mind that all the inputs are of Type int16 in this example and the output is of type bool.

Use the Check on the main package (default hotkey: F3) to confirm that no errors are detected.

The resulting diagram should look like this:

Fig 4 Resulting Diagram

We are now ready to simulate the model. To do so, we first have to assign the Main operator in the Simulation General Settings and then Build the model.

After clicking the Run button in the Code Generator (Simulation) toolbar, we should select to Watch the three input variables and to Graph the output. The simulation can be started with the Go button after assigning some meaningful values to the three inputs. The resulting pulse will be plotted in the graph in real time. An instance can look like this:

Fig 5 Resulting Pulse Graph

In this example, the position of 20 was manually assigned at the 15th step and the pulse stayed one for 2 steps, as calculated for the specific coefficient and frequency.

We can now take this further by connecting this simulation to a graphical output.