FYI - I think the code above will work to switch the port numbers. I still don't understand what is meant by 'not tunable during simulation'. Does that just mean while the object is running - i.e. you need to use the 'release' command first?
Tunable IP Port for dsp.udpsender in generated code
조회 수: 2 (최근 30일)
이전 댓글 표시
I have an application where I need to serve data over some number UDP ports (not known at compile time) and want to developed an exectuable to do so from coder. I would like to generate a single dsp.udpsender object and then change its remoteIPport property as I switch between each dataset. Something like this:
function [] = example(portnumbers)
mydata = [1, 2, 3, 4;...
5, 6, 7, 8];
udpSend = dsp.UDPSender('RemoteIPPort',portnumbers(i));
release(udpSend)
for i = 1:size(mydata,2)
udpSend.RemoteIPPort = portnumbers(i);
udpSend(mydata(i,:));
release(udpSend)
end
In the documentation for dsp.udpsender it seems like this should be possible, but I see a note in the Extended Capabilities Section onf C/C++ Code Generation that says, "The RemoteIPPort property is tunable in generated code but not tunable during simulation."
This note is unclear. Does this mean I can't have the property updated when the generated code is running? I don't know what it means to be tunable in generated code but not during simulation. If someone could explain this or provide a method to do what I am trying above I would appreciate it.
I have gotten around this in the past by just making a cell array of a large nunmber of udpsender objects and then calling them individually within the for loop, but this is extremely inefficient.
답변 (1개)
Sarthak
2023년 4월 21일
Hi Michael,
As per my understanding, as mentioned in the documentation RemoteIPPort property is tunable in generated code and not tunable during simulation.
This means that if you are running a simulation of your MATLAB code that includes the "dsp.UDPSender" object, you cannot change the value of the "RemoteIPPort" property during simulation. This means that the IP port number of the remote host to which the UDP packets are sent will remain constant throughout the simulation and cannot be modified dynamically during simulation.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Code Generation and Deployment에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!