2019-08-22 15:48:47 +02:00
|
|
|
tg = slrt;
|
|
|
|
|
|
|
|
%%
|
2019-09-12 16:12:01 +02:00
|
|
|
if tg.Connected == "Yes"
|
|
|
|
if tg.Status == "stopped"
|
|
|
|
%% Load the application
|
|
|
|
tg.load('test_cercalo');
|
|
|
|
|
|
|
|
%% Run the application
|
|
|
|
tg.start;
|
|
|
|
pause(101);
|
|
|
|
tg.stop;
|
|
|
|
end
|
|
|
|
end
|
2019-08-22 15:48:47 +02:00
|
|
|
|
2019-09-10 16:05:05 +02:00
|
|
|
%%
|
|
|
|
f = SimulinkRealTime.openFTP(tg);
|
|
|
|
mget(f, 'data/data_001.dat');
|
|
|
|
close(f);
|
2019-08-22 15:48:47 +02:00
|
|
|
|
|
|
|
%% Convert the Data
|
|
|
|
data = SimulinkRealTime.utils.getFileScopeData('data/data_001.dat').data;
|
|
|
|
|
2019-09-13 16:24:53 +02:00
|
|
|
Uch = data(:, 1);
|
|
|
|
Ucv = data(:, 2);
|
|
|
|
Unh = data(:, 3);
|
|
|
|
Unv = data(:, 4);
|
|
|
|
Vph = data(:, 5);
|
|
|
|
Vpv = data(:, 6);
|
|
|
|
Vch = data(:, 7);
|
|
|
|
Vcv = data(:, 8);
|
|
|
|
Vnh = data(:, 9);
|
|
|
|
Vnv = data(:, 10);
|
|
|
|
Va = data(:, 11);
|
2019-08-22 15:48:47 +02:00
|
|
|
t = data(:, end);
|
|
|
|
|
|
|
|
%% Plot the data
|
|
|
|
figure;
|
2019-09-13 16:24:53 +02:00
|
|
|
subplot(2, 3, 1);
|
2019-08-22 15:48:47 +02:00
|
|
|
hold on;
|
2019-09-13 16:24:53 +02:00
|
|
|
plot(t, Ucv, 'DisplayName', 'Ucv');
|
|
|
|
plot(t, Vpv, 'DisplayName', 'Vpv');
|
2019-08-22 15:48:47 +02:00
|
|
|
hold off
|
|
|
|
xlabel('Time [s]');
|
|
|
|
ylabel('Voltage [V]');
|
2019-09-12 16:12:01 +02:00
|
|
|
legend();
|
2019-08-22 15:48:47 +02:00
|
|
|
|
2019-09-13 16:24:53 +02:00
|
|
|
subplot(2, 3, 2);
|
2019-09-10 16:05:05 +02:00
|
|
|
hold on;
|
2019-09-13 16:24:53 +02:00
|
|
|
plot(t, Uch, 'DisplayName', 'Uch');
|
|
|
|
plot(t, Vph, 'DisplayName', 'Vph');
|
2019-09-10 16:05:05 +02:00
|
|
|
hold off
|
|
|
|
xlabel('Time [s]');
|
|
|
|
ylabel('Voltage [V]');
|
2019-09-12 16:12:01 +02:00
|
|
|
legend();
|
|
|
|
|
2019-09-13 16:24:53 +02:00
|
|
|
subplot(2, 3, 3);
|
|
|
|
hold on;
|
|
|
|
plot(t, Vch, 'DisplayName', 'Vch');
|
|
|
|
plot(t, Vcv, 'DisplayName', 'Vcv');
|
|
|
|
hold off
|
|
|
|
xlabel('Time [s]');
|
|
|
|
ylabel('Voltage [V]');
|
|
|
|
legend();
|
|
|
|
|
|
|
|
subplot(2, 3, 4);
|
2019-09-12 16:12:01 +02:00
|
|
|
hold on;
|
2019-09-13 16:24:53 +02:00
|
|
|
plot(t, Unh, 'DisplayName', 'Unh');
|
|
|
|
plot(t, Vnh, 'DisplayName', 'Vnh');
|
2019-09-12 16:12:01 +02:00
|
|
|
hold off
|
|
|
|
xlabel('Time [s]');
|
|
|
|
ylabel('Voltage [V]');
|
|
|
|
legend();
|
|
|
|
|
2019-09-13 16:24:53 +02:00
|
|
|
subplot(2, 3, 5);
|
|
|
|
hold on;
|
|
|
|
plot(t, Unv, 'DisplayName', 'Unv');
|
|
|
|
plot(t, Vnv, 'DisplayName', 'Vnv');
|
|
|
|
hold off
|
|
|
|
xlabel('Time [s]');
|
|
|
|
ylabel('Voltage [V]');
|
|
|
|
legend();
|
|
|
|
|
|
|
|
subplot(2, 3, 6);
|
|
|
|
hold on;
|
|
|
|
plot(t, Va, 'DisplayName', 'Va');
|
|
|
|
hold off
|
|
|
|
xlabel('Time [s]');
|
|
|
|
ylabel('Distance [m]');
|
|
|
|
legend();
|
|
|
|
|
2019-09-12 16:12:01 +02:00
|
|
|
%% Save
|
2019-09-17 17:27:23 +02:00
|
|
|
save('mat/data_rep_1.mat', 't', 'Uch', 'Ucv', ...
|
2019-09-13 16:24:53 +02:00
|
|
|
'Unh', 'Unv', ...
|
|
|
|
'Vph', 'Vpv', ...
|
|
|
|
'Vch', 'Vcv', ...
|
|
|
|
'Vnh', 'Vnv', ...
|
|
|
|
'Va');
|
2019-09-19 17:28:00 +02:00
|
|
|
|
|
|
|
%% Save - Huddle Test
|
|
|
|
save('mat/data_huddle_test_4.mat', 't', 'Vph', 'Vpv', 'Va');
|