Can the IP address and port of UDP blocks be changed at run-time?

3 visualizaciones (últimos 30 días)
Tyler
Tyler el 26 de Abr. de 2017
Respondida: Tushar Upadhyay el 2 de Mayo de 2017
Is there a way to change where a UDP block is sending data at run-time?
This UDP block can be the one in the Instrument Control Toolbox, Raspberry Pi Hardware Support Package, etc.
It doesn't matter, I just need any UDP send block that can have it's parameters changed at run-time.
Note: it must be supported for code generation.
Regards,
Tyler

Respuestas (1)

Tushar Upadhyay
Tushar Upadhyay el 2 de Mayo de 2017
One way to do is to use Raspberry Pi UDP block and provide variable names instead of IP address and port number in the parameters.
For example:
IP address: IP Port number: Port
NOTE: Here, IP and Port are variable.
If you generate the c code using code gen of the model, then user driver code needs to change the values of the variables given in the parameters for IP address and Port number.
If you use it in the external mode and burn the binary to the board, then you can manipulate the variables values through MATLAB workspace.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by