MATLAB Answers

Simulink error using dsp.UDPSender in MATLAB function

4 views (last 30 days)
Sarbajit Basu
Sarbajit Basu on 31 May 2021
Answered: Chidvi Modala on 3 Jun 2021
Hello everyone,
I have a very simple Simulink file. A pulse generator with a frequency of 60 Hz, amplitude of 1 and pulse width of 0.01. I have inserted a MATLAB function in the model that should enable sending a udp packet to an IP address when the pulse is high.
When I run a MATLAB script to send an UDP packet it works fine. When I run Simulink model with MATLAB function minus the UDP send command, it works fine. When I run any Simulink model it works fine.
Only and only when I run a Simulink model with a MATLAB function that has udp sending involved, it throws me a tantrum. Instead of MATLAB function, if I use the UDP send MATLAB function, I have the same error.
If I run the same model with the function on a different computer, it works fine.
It is only and only on one computer that it doesn't run.
The Function is: function y = fcn(u)
udps=dsp.UDPSender('RemoteIPAddress','169.254.8.179', 'RemoteIPPort',25000);
if u>0
udps(u)
y=u;
else
y=0;
end
end
I do have a MinGW compiler in my system.
Already tried re-installing MATLAB.
Thanks in advance!!!

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!