From: weiling on
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
"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
"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
"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
"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.