Frequently Asked Question

Video: 2.3.1 User-model interaction and data acquisition
Last Updated 3 years ago


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

00:00:02

Hello there, now we will show you how to use HIL SCADA in a more advanced way.  

00:00:07

Also, we will introduce the trigger settings in Capture and Scope,  

00:00:10

how to export captured data, how to stream and log a signal to the external file,  

00:00:15

and more. We will be continuing with our model from module 2.2, HIL SCADA.  

00:00:20

First, let’s modify the model a little bit.

00:00:29

Let’s add a contactor to simulate the phase losses in the induction machine.  

00:00:34

For this, we can go to the Library Explorer, Contactor folder,  

00:00:38

Ideal, and then drag and drop the Single Pole Single Throw Contactor on phase C. 

00:00:48

Now let’s add a resistor on the DC side of the inverter.  

00:00:52

You can find this, along with all other passive components, in the Passive Components library.  

00:00:59

Let’s add it to the DC line and set the value of the resistor to 0.1 ohm. 

00:01:10

Also, let’s add two more current measurements, one to phase B and one to phase C.  

00:01:15

Let’s change the names to Ib and Ic. 

00:01:24

Let’s compile this model again and let’s open it in HIL SCADA. 

00:01:59

From the panel files found in model directory let’s open the  

00:02:02

SCADA panel we saved in module 2.2 HIL SCADA.Since we have added a contactor, we will need to  

00:02:12

control it. To do that let’s open the Contactors dialog in Model Settings. As you may remember,  

00:02:18

we use Model Settings to set all controllable variables from the model, as well as to define  

00:02:24

analog and digital outputs. In addition, it is possible to override the state of switches  

00:02:30

in the converter, as well as directly set the initial parameters for the machine, among others. 

00:02:35

Now let’s set the state of the contactor. First, let’s turn on Software Control of the contactor.  

00:02:42

The normal state of the contactor should be closed for our model. We can close the contactor here,  

00:02:48

or we can use our HIL API and Code Editor inside the Panel Initialization dialog. 

00:02:54

Let’s open Panel Initialization, and let’s enable Code Editor.  

00:02:59

Now, let’s find the contactor S1, check the checkbox, and set the state to Closed. Let’s  

00:03:06

set the cursor on the line where we want to insert the code. Now we can insert this  

00:03:10

code to the Panel Initialization. Let’s save and close the Panel Initialization. 

00:03:16

Now, whenever we start the simulation, the Panel Initialization script will automatically run. 

00:03:23

Now let’s start the simulation. Let’s open Model Settings, and now we can see  

00:03:27

that the contactor is controllable from the software and the state is closed. 

00:03:31

We can also control the contactor using Action widgets in the Library.  

00:03:36

Let’s use the Check Box and drag and drop it to the SCADA panel. Let’s double-click it,  

00:03:42

we can see that we already have a template for the contactor logic, and the state of the Check Box is  

00:03:46

available through the variable 'inputValue'. Also, let’s rename the Check Box to “Contactor state”.  

00:03:54

Now, the Code Editor can help us. Let’s again find the contactor and insert the code in the  

00:04:00

macro code. If the checkbox is checked the contactor is in the Closed state,  

00:04:05

and if checkbox is unchecked the contactor is in the Open state.  

00:04:09

In this way you can enable or set all controllable variables in the model. 

00:04:25

To observe all signals in real time, we need to use Capture/Scope.  

00:04:29

Let’s open it and capture some signals. Before doing that let’s add the two additional current  

00:04:34

measurements that we add in the model. Let’s go to the signals and add two more signals.  

00:04:41

Now we can add Ib and Ic to view port 1. Also, let’s add the feedback from the contactor.  

00:04:48

The feedback from the S1 contactor is embedded. To include the feedback, we need to switch to  

00:04:55

the digital dialog and add a new signal. Now let’s type S1_fb and choose third viewport.  

00:05:01

In this way we can access the feedback from contactors in the Typhoon HIL SCADA environment. 

00:05:07

As you can see, we don’t have a S1_fb probe in the model, this feedback is embedded in  

00:05:13

the component itself. You can find similar data readings for the machines and converters. 

00:05:21

Let’s choose a time interval of 0.1s and let to the force trigger. 

00:05:30

Now it is time to show how you can enable the trigger capture in Capture Scope.  

00:05:34

First, let’s open the capture trigger settings. Here we can define the type of the signal,  

00:05:40

source for the trigger settings, rising of falling edge, threshold for analog signal,  

00:05:45

offset and use first trigger checkbox.To set the trigger on the contactor S1 we  

00:05:51

need to set the digital type of the signal, the source is S1 feedback,  

00:05:55

we want to trigger on the falling edge and to capture 50% of time before the event. 

00:06:02

Also, let’s enable the trigger. At the bottom of the window,  

00:06:06

we can see that Capture is waiting for the trigger.  

00:06:09

Now, let’s open the contactor by unchecking the checkbox “Contactor state”. In the message  

00:06:15

console we can see that the Trigger is detected and capture automatically plotted the data. 

00:06:26

At this moment we would like to introduce the cursors. Cursors let you measure data values at  

00:06:31

a specific point of time in the capture, as well as compare performance over a period of time.  

00:06:37

You can add a cursor at a position or at the value. To do that, you need to right click  

00:06:43

in one of the viewports and add the cursors. Let’s add at this position. The signal data  

00:06:49

automatically opens. We can move the cursor after it is placed. We can also add a second  

00:06:55

cursor to measure the time delta, minimum or maximum value of the signals, absolute max,  

00:07:01

as well as, mean and root mean square values between the two cursors. Let’s do that. 

00:07:12

Let’s remove the cursors by right-clicking on the viewport and selecting Remove all Cursors.  

00:07:17

Now it is a good time to show you more possibilities in Capture Scope. The first  

00:07:21

possibility is to export the captured data in different formats. Let we show you how to do that.  

00:07:29

There is a small icon at the bottom of the window just to the right of the zoom controls. This is  

00:07:34

the Export signals to file window. Let’s click on it. Here we can export all signals in the format  

00:07:41

of our choice, or just the selected signals.Let’s export all signals in the .csv file. Let’s  

00:07:48

find the folder where we saved the model and change the file name to the “Fault.csv”. 

00:07:59

Now let’s open the .csv file and see the values. 

00:08:08

Also, we would like to introduce the Fast Fourier Transformation, or FFT, analysis of the captured  

00:08:14

signal. To do the analysis, you can find the button at the bottom of the Capture Scope dialog.  

00:08:20

Here you can find more information about harmonics of the captured signals. 

00:08:34

Also, at this moment we would like to introduce the signal and stream data loggers.  

00:08:40

Enabling Signal streaming allows acquisition and logging the signal at a medium sample rate.  

00:08:47

Signals can be streamed at up to 512 kilosamples per second for all execution rates. In case  

00:08:54

bandwidth is exceeded, the model can be changed to reduce the number of streaming signals or  

00:08:59

increase the Signal Processing execution rate. Firstly, let’s stop the model simulation.  

00:09:06

Then, let’s jump back at the model, to enable the signal streaming for the Iarms probe. 

00:09:22

Visually you can see that the Iarms is now a streaming probe. 

00:09:26

Let’s compile and load the modified the model. 

00:09:35

Let’s back to the SCADA panel, lets drag and drop the stream data logger widget from the library.  

00:09:41

Let’s double-click on it and see what we have inside.  

00:09:45

The Stream Data Logger widget stores a stream of data that comes from Streaming Analog and Digital  

00:09:49

signals to a user-specified .csv, .h5, or .mf4 data file. In this case, we will choose .csv. 

00:09:59

Let’s add the Iarms streaming probe in the streaming signals settings. Also, we can save  

00:10:05

the streaming file in the Panel File directory. Also, let’s set the log file name of the streaming  

00:10:12

signal to Iarms_streaming and click Ok. The logging will start when the simulation begins.  

00:10:18

Let’s start the simulation and then stop it after at least two seconds of simulation  

00:10:23

time. Remember that you can see that in the bottom right of HIL SCADA. 

00:10:43

Now, let’s open the saved file. 

00:11:01

Let’s now drag and drop another logger. The signal data logger stores arbitrary number of analog  

00:11:07

and digital signals’ data to the user specified .mat or .csv data file. Logging can be started  

00:11:14

on simulation start and paused (and started again) with the dedicated button. This widget  

00:11:19

is similar to the monitoring widgets, except the collected data are not visualized; they are stored  

00:11:24

in a data file for further analysis instead. The sample rate can be 250, 500, or 1000 mili seconds.  

00:11:34

We will use a sampling rate of 250 mili seconds. Let’s follow a similar process as we did with the  

00:11:40

steaming logger, only in this case let’s log the machine speed. As in the previous case,  

00:11:47

let’s use a .csv file. Let’s find the machine speed analog signal in Signal Settings, and  

00:11:54

let’s set the log file name to speed_logger. If the simulation is running, we can just press the  

00:12:00

Start button on the signal data logger and it will start logging. Let’s log for a few seconds. 

00:12:26

Now, let’s open the signal data logger file. 

00:12:43

In this session you learned how to use Capture/Scope widget, exporting the data,  

00:12:47

basics of HIL API and Code Editor, multiple ways to control variables in the model,  

00:12:52

as well as, signal and streaming data logging.

Please Wait!

Please wait... it will take a second!