I want to control a laboratory instrument via UDP - and receive its response. I can do it using functions from the 'Instrument Control Toolbox' ('udp' and 'udpport'). However, I would rather prefer to do it using the 'DSP System Toolbox' which is much more common among my colleagues.
The 'DSP System Toolbox' offers 'dsp.UDPSender' and 'dsp.UDPReceiver'. Sending using 'dsp.UDPSender' works fine, but I have not succeeded in receivng the response from the instrument via 'dsp.UDPReceiver': I receive only empty data.
This code example shows first the two working methods from 'Instrument Control Toolbox' - and then my attemp using 'DSP System Toolbox' in wich receiving fails:
msg = uint8([ 1 0 10 11 ]);
u = udp('192.168.10.110',6667);
write(up,msg,"uint8","192.168.10.110",6667);
disp('With UDPSender/UDPReceiver:')
udps = dsp.UDPSender( 'RemoteIPPort',6667,'RemoteIPAddress','192.168.10.110');
udpr = dsp.UDPReceiver('LocalIPPort', 6667,'RemoteIPAddress','192.168.10.110');
Calling 'udpr()' before sending as well as repeatedly after (as in the comments in the code example) does not fetch any response.
An update/answer to previous question about 'dspUDPReceiver' claimed that a solution was to run matlab as administrator. It does not help in my case.
I have been suggested it could be a firewall ussue. So I had my IT support to open port 6667 for matlab (I am not authorized to do so myself). It did not help in my case.
Shouldn't 'dsp.UDPSender' and 'dsp.UDPReceiver' be capable of doing the job?
Thanks for any responses!
Martin