MATLAB Answers

0

Is it possible to connect to a UDP multicast using the Instrument Control Toolbox 2.2 (R14SP2)?

I would like to make a connection to UDP multicast using the Instrument Control Toolbox 2.2 (R14SP2).

2 Answers

Answer by MathWorks Support Team on 16 Jul 2018
Edited by MathWorks Support Team on 16 Jul 2018
 Accepted Answer

The ability to connect to a UDP multicast is not available in the Instrument Control Toolbox 2.2 (R14SP2).
As a workaround to connect to a UDP multicast, you can do the following:
1. Use a Java multicast socket to access it directly from MATLAB. For more information, see javadoc or tutorials for the "core java.net" classes from Sun, specifically "java.net.MulticastSocket". This could be found at:
<http://download.java.net/jdk7/archive/b123/docs/api/java/net/MulticastSocket.html>
Information on using Java with MATLAB in the 'External Interfaces' section of the MATLAB documentation can be accessed by typing the following command at the MATLAB command prompt:
web([docroot,'/techdoc/apiref/ch00intr.html'])
2. Write your own functions in C that use standard sockets and have a MEX wrapper call those functions. You can find more information on MEX-files at:
<http://www.mathworks.com/support/tech-notes/1600/1605.html>

  0 Comments

Sign in to comment.


Answer by Vinod
on 19 Oct 2016
Edited by Vinod
on 20 Oct 2016

If you are using MATLAB R2016b or newer, take a look at this example: http://www.mathworks.com/matlabcentral/fileexchange/59156
Technically it is UDP broadcast, but it achieves the need of multiple devices on the same subnet, whose IP addresses are not known at the time of development of the MATLAB program, to receive messages from the MATLAB program.

  0 Comments

Sign in to comment.