From: weiling on 9 Aug 2010 06:55 i want to create tcp/ip communication between matlab and another instrument. now i can see with netstat -a, that tcp/ip is estabilished. but in the side of matlab, i can not run fread. code of matlab: t=tcpip('192.168.1.2',12323) fopen=(t) fwrite(t,'test') freade(t, 10) after long time wait come a warning: The specified amount of data was not returned within the Timeout period. i have tried char(fread(t,t.BytesAvailable)) ??? Error using ==> icinterface.fread at 163 SIZE must be greater than 0. does anyone have ideas? where is the problem? thx!
From: weiling on 9 Aug 2010 07:27 "weiling " <wwl1982_787(a)hotmail.com> wrote in message <i3omqa$i3d$1(a)fred.mathworks.com>... > i want to create tcp/ip communication between matlab and another instrument. > now i can see with netstat -a, that tcp/ip is estabilished. > but in the side of matlab, i can not run fread. > > code of matlab: > t=tcpip('192.168.1.2',12323) > fopen=(t) > fwrite(t,'test') > freade(t, 10) > after long time wait come a warning: The specified amount of data was not returned within the Timeout period. > > i have tried char(fread(t,t.BytesAvailable)) > ??? Error using ==> icinterface.fread at 163 > SIZE must be greater than 0. > > > does anyone have ideas? where is the problem? > thx! i can send data from matlab to another instrument. wenn i run fwrite and then fprintf, i can see the data on the another instrument. but why can i not see the data on the matlab use fread?
From: us on 9 Aug 2010 07:31 "weiling " <wwl1982_787(a)hotmail.com> wrote in message <i3oom9$hjo$1(a)fred.mathworks.com>... > "weiling " <wwl1982_787(a)hotmail.com> wrote in message <i3omqa$i3d$1(a)fred.mathworks.com>... > > i want to create tcp/ip communication between matlab and another instrument. > > now i can see with netstat -a, that tcp/ip is estabilished. > > but in the side of matlab, i can not run fread. > > > > code of matlab: > > t=tcpip('192.168.1.2',12323) > > fopen=(t) > > fwrite(t,'test') > > freade(t, 10) > > after long time wait come a warning: The specified amount of data was not returned within the Timeout period. > > > > i have tried char(fread(t,t.BytesAvailable)) > > ??? Error using ==> icinterface.fread at 163 > > SIZE must be greater than 0. > > > > > > does anyone have ideas? where is the problem? > > thx! > > > i can send data from matlab to another instrument. > wenn i run fwrite and then fprintf, i can see the data on the another instrument. > but why can i not see the data on the matlab use fread? what happens if you decrease the amount of data FREAD has to read(?)... us
From: weiling on 9 Aug 2010 07:43 "us " <us(a)neurol.unizh.ch> wrote in message <i3ootp$2vg$1(a)fred.mathworks.com>... > "weiling " <wwl1982_787(a)hotmail.com> wrote in message <i3oom9$hjo$1(a)fred.mathworks.com>... > > "weiling " <wwl1982_787(a)hotmail.com> wrote in message <i3omqa$i3d$1(a)fred.mathworks.com>... > > > i want to create tcp/ip communication between matlab and another instrument. > > > now i can see with netstat -a, that tcp/ip is estabilished. > > > but in the side of matlab, i can not run fread. > > > > > > code of matlab: > > > t=tcpip('192.168.1.2',12323) > > > fopen=(t) > > > fwrite(t,'test') > > > freade(t, 10) > > > after long time wait come a warning: The specified amount of data was not returned within the Timeout period. > > > > > > i have tried char(fread(t,t.BytesAvailable)) > > > ??? Error using ==> icinterface.fread at 163 > > > SIZE must be greater than 0. > > > > > > > > > does anyone have ideas? where is the problem? > > > thx! > > > > > > i can send data from matlab to another instrument. > > wenn i run fwrite and then fprintf, i can see the data on the another instrument. > > but why can i not see the data on the matlab use fread? > > what happens if you decrease the amount of data FREAD has to read(?)... > > us always Warning: The specified amount of data was not returned within the Timeout period.
From: weiling on 9 Aug 2010 07:46 "us " <us(a)neurol.unizh.ch> wrote in message <i3ootp$2vg$1(a)fred.mathworks.com>... > "weiling " <wwl1982_787(a)hotmail.com> wrote in message <i3oom9$hjo$1(a)fred.mathworks.com>... > > "weiling " <wwl1982_787(a)hotmail.com> wrote in message <i3omqa$i3d$1(a)fred.mathworks.com>... > > > i want to create tcp/ip communication between matlab and another instrument. > > > now i can see with netstat -a, that tcp/ip is estabilished. > > > but in the side of matlab, i can not run fread. > > > > > > code of matlab: > > > t=tcpip('192.168.1.2',12323) > > > fopen=(t) > > > fwrite(t,'test') > > > freade(t, 10) > > > after long time wait come a warning: The specified amount of data was not returned within the Timeout period. > > > > > > i have tried char(fread(t,t.BytesAvailable)) > > > ??? Error using ==> icinterface.fread at 163 > > > SIZE must be greater than 0. > > > > > > > > > does anyone have ideas? where is the problem? > > > thx! > > > > > > i can send data from matlab to another instrument. > > wenn i run fwrite and then fprintf, i can see the data on the another instrument. > > but why can i not see the data on the matlab use fread? > > what happens if you decrease the amount of data FREAD has to read(?)... > > us always Warning: The specified amount of data was not returned within the Timeout period.
|
Next
|
Last
Pages: 1 2 Prev: Error while running COM automation server Next: Export COMSOL FEM mesh to MATLAB |