Frequently Asked Question
Press "Ctrl + F" to find the keyword of your interest.
If you wish to have a direct link access to the video timestamps, please follow these instructions.
Found this video helpful? Why not take the whole HIL Specialist course? A Certificate is waiting for you for free at HIL Academy.
Would you or your organization benefit from having these videos narrated in your native language? Contact us and let us know if you wish to contribute.
TRANSCRIPT
Hello there, now we will show you how to use HIL SCADA in a more advanced way.
Also, we will introduce the trigger settings in Capture and Scope,
how to export captured data, how to stream and log a signal to the external file,
and more. We will be continuing with our model from module 2.2, HIL SCADA.
First, let’s modify the model a little bit.
Let’s add a contactor to simulate the phase losses in the induction machine.
For this, we can go to the Library Explorer, Contactor folder,
Ideal, and then drag and drop the Single Pole Single Throw Contactor on phase C.
Now let’s add a resistor on the DC side of the inverter.
You can find this, along with all other passive components, in the Passive Components library.
Let’s add it to the DC line and set the value of the resistor to 0.1 ohm.
Also, let’s add two more current measurements, one to phase B and one to phase C.
Let’s change the names to Ib and Ic.
Let’s compile this model again and let’s open it in HIL SCADA.
From the panel files found in model directory let’s open the
SCADA panel we saved in module 2.2 HIL SCADA.Since we have added a contactor, we will need to
control it. To do that let’s open the Contactors dialog in Model Settings. As you may remember,
we use Model Settings to set all controllable variables from the model, as well as to define
analog and digital outputs. In addition, it is possible to override the state of switches
in the converter, as well as directly set the initial parameters for the machine, among others.
Now let’s set the state of the contactor. First, let’s turn on Software Control of the contactor.
The normal state of the contactor should be closed for our model. We can close the contactor here,
or we can use our HIL API and Code Editor inside the Panel Initialization dialog.
Let’s open Panel Initialization, and let’s enable Code Editor.
Now, let’s find the contactor S1, check the checkbox, and set the state to Closed. Let’s
set the cursor on the line where we want to insert the code. Now we can insert this
code to the Panel Initialization. Let’s save and close the Panel Initialization.
Now, whenever we start the simulation, the Panel Initialization script will automatically run.
Now let’s start the simulation. Let’s open Model Settings, and now we can see
that the contactor is controllable from the software and the state is closed.
We can also control the contactor using Action widgets in the Library.
Let’s use the Check Box and drag and drop it to the SCADA panel. Let’s double-click it,
we can see that we already have a template for the contactor logic, and the state of the Check Box is
available through the variable 'inputValue'. Also, let’s rename the Check Box to “Contactor state”.
Now, the Code Editor can help us. Let’s again find the contactor and insert the code in the
macro code. If the checkbox is checked the contactor is in the Closed state,
and if checkbox is unchecked the contactor is in the Open state.
In this way you can enable or set all controllable variables in the model.
To observe all signals in real time, we need to use Capture/Scope.
Let’s open it and capture some signals. Before doing that let’s add the two additional current
measurements that we add in the model. Let’s go to the signals and add two more signals.
Now we can add Ib and Ic to view port 1. Also, let’s add the feedback from the contactor.
The feedback from the S1 contactor is embedded. To include the feedback, we need to switch to
the digital dialog and add a new signal. Now let’s type S1_fb and choose third viewport.
In this way we can access the feedback from contactors in the Typhoon HIL SCADA environment.
As you can see, we don’t have a S1_fb probe in the model, this feedback is embedded in
the component itself. You can find similar data readings for the machines and converters.
Let’s choose a time interval of 0.1s and let to the force trigger.
Now it is time to show how you can enable the trigger capture in Capture Scope.
First, let’s open the capture trigger settings. Here we can define the type of the signal,
source for the trigger settings, rising of falling edge, threshold for analog signal,
offset and use first trigger checkbox.To set the trigger on the contactor S1 we
need to set the digital type of the signal, the source is S1 feedback,
we want to trigger on the falling edge and to capture 50% of time before the event.
Also, let’s enable the trigger. At the bottom of the window,
we can see that Capture is waiting for the trigger.
Now, let’s open the contactor by unchecking the checkbox “Contactor state”. In the message
console we can see that the Trigger is detected and capture automatically plotted the data.
At this moment we would like to introduce the cursors. Cursors let you measure data values at
a specific point of time in the capture, as well as compare performance over a period of time.
You can add a cursor at a position or at the value. To do that, you need to right click
in one of the viewports and add the cursors. Let’s add at this position. The signal data
automatically opens. We can move the cursor after it is placed. We can also add a second
cursor to measure the time delta, minimum or maximum value of the signals, absolute max,
as well as, mean and root mean square values between the two cursors. Let’s do that.
Let’s remove the cursors by right-clicking on the viewport and selecting Remove all Cursors.
Now it is a good time to show you more possibilities in Capture Scope. The first
possibility is to export the captured data in different formats. Let we show you how to do that.
There is a small icon at the bottom of the window just to the right of the zoom controls. This is
the Export signals to file window. Let’s click on it. Here we can export all signals in the format
of our choice, or just the selected signals.Let’s export all signals in the .csv file. Let’s
find the folder where we saved the model and change the file name to the “Fault.csv”.
Now let’s open the .csv file and see the values.
Also, we would like to introduce the Fast Fourier Transformation, or FFT, analysis of the captured
signal. To do the analysis, you can find the button at the bottom of the Capture Scope dialog.
Here you can find more information about harmonics of the captured signals.
Also, at this moment we would like to introduce the signal and stream data loggers.
Enabling Signal streaming allows acquisition and logging the signal at a medium sample rate.
Signals can be streamed at up to 512 kilosamples per second for all execution rates. In case
bandwidth is exceeded, the model can be changed to reduce the number of streaming signals or
increase the Signal Processing execution rate. Firstly, let’s stop the model simulation.
Then, let’s jump back at the model, to enable the signal streaming for the Iarms probe.
Visually you can see that the Iarms is now a streaming probe.
Let’s compile and load the modified the model.
Let’s back to the SCADA panel, lets drag and drop the stream data logger widget from the library.
Let’s double-click on it and see what we have inside.
The Stream Data Logger widget stores a stream of data that comes from Streaming Analog and Digital
signals to a user-specified .csv, .h5, or .mf4 data file. In this case, we will choose .csv.
Let’s add the Iarms streaming probe in the streaming signals settings. Also, we can save
the streaming file in the Panel File directory. Also, let’s set the log file name of the streaming
signal to Iarms_streaming and click Ok. The logging will start when the simulation begins.
Let’s start the simulation and then stop it after at least two seconds of simulation
time. Remember that you can see that in the bottom right of HIL SCADA.
Now, let’s open the saved file.
Let’s now drag and drop another logger. The signal data logger stores arbitrary number of analog
and digital signals’ data to the user specified .mat or .csv data file. Logging can be started
on simulation start and paused (and started again) with the dedicated button. This widget
is similar to the monitoring widgets, except the collected data are not visualized; they are stored
in a data file for further analysis instead. The sample rate can be 250, 500, or 1000 mili seconds.
We will use a sampling rate of 250 mili seconds. Let’s follow a similar process as we did with the
steaming logger, only in this case let’s log the machine speed. As in the previous case,
let’s use a .csv file. Let’s find the machine speed analog signal in Signal Settings, and
let’s set the log file name to speed_logger. If the simulation is running, we can just press the
Start button on the signal data logger and it will start logging. Let’s log for a few seconds.
Now, let’s open the signal data logger file.
In this session you learned how to use Capture/Scope widget, exporting the data,
basics of HIL API and Code Editor, multiple ways to control variables in the model,
as well as, signal and streaming data logging.