View Single Post
  #5  
Old 12-09-2016, 04:26 PM
sagar29 sagar29 is offline
Member
 
Join Date: Oct 2016
Posts: 7
Hello,
I amtrying to send 5 bytes from matlab. MATLAb is first taking 6 bytes, creating packet and sending it over UDP. To verify whether MATLAB is sending data or not, I ran MATLAB receiver on vizard PC and and I was able to get proper data.

When I am running this code:
import viz
import viznet

viz.go()

myNetwork=viz.addNetwork('192.168.1.2')

def onNetwork(e):
if isinstance(e,viz.RawNetworkEvent):
print 'data', e.raw_data
print 'address', e.address
print 'port', e.port

viz.callback(viz.NETWORK_EVENT,onNetwork)

I am getting
data #############p@#####@f@#####@ @######i@address 192.168.1.2port 4950data ##############q@#####@f@#####@ @######i@address 192.168.1.2port 4950data ##############q@#####@f@#####@ @######i@address 192.168.1.2port 4950data #############0q@#####@f@#####@ @######i@address 192.168.1.2port 4950data #############Hq@#####@f@#####@ @######i@address 192.168.1.2port 4950data #############`q@#####@f@#####@ @######i@address 192.168.1.2port 4950data #############xq@#####@f@#####@ @######i@address 192.168.1.2port 4950data ############# q@#####@f@#####@ @######i@ address 192.168.1.2port 4950data #############q@#####@f@#####@ @######i@address 192.168.1.2port 4950data #############q@#####@f@#####@ @######i@address 192.168.1.2port 4950data #############q@#####@f@#####@ @######i@address 192.168.1.2port 4950data #############q@#####@f@#####@ @######i@

and after running print e.raw_data:
I am getting random numbers. In this case, port and IP I am getting properly but problem is with data.
Reply With Quote