From: Wei He on 16 Jun 2010 13:35 Helo, everyone, I am using the instrument control toolbox to control an oscilloscope. I need to order the matlab to wait for the oscilloscope to get enough I want to know that whether it is possible to disable the timeout in order to wait for the Oscilloscpe?? the maximal timeout time is 1000s, it a very long time, but I don't want to define a specific time. because the wait time maybe is longer than that. So i think it's better to disable it Can anyone tell me is it possible?? and How? Thanks in advance! Wei.
From: Trent Jarvi on 16 Jun 2010 14:44 "Wei He" <Eric.he(a)hotmail.com> wrote in message news:hvb20p$pmf$1(a)fred.mathworks.com... > Helo, everyone, > I am using the instrument control toolbox to control an oscilloscope. > I need to order the matlab to wait for the oscilloscope to get enough > I want to know that whether it is possible to disable the timeout in > order to wait for the Oscilloscpe?? > > the maximal timeout time is 1000s, it a very long time, but I don't > want to define a specific time. because the wait time maybe is longer than > that. So i think it's better to disable it > > Can anyone tell me is it possible?? and How? > Hi Wei, There isn't a way to disable the timeout. You can set the timeout to large values to prevent timeouts for all practical purposes. It may also make sense to explore callbacks that can execute your code when the expected number of bytes are available. This frees MATLAB to do other things while waiting for the data. I'll make a note of your request for the developers.
From: Vinod Cherian on 16 Jun 2010 15:00 "Wei He" <Eric.he(a)hotmail.com> wrote in message <hvb20p$pmf$1(a)fred.mathworks.com>... > Helo, everyone, > I am using the instrument control toolbox to control an oscilloscope. I need to order the matlab to wait for the oscilloscope to get enough > I want to know that whether it is possible to disable the timeout in order to wait for the Oscilloscpe?? > > the maximal timeout time is 1000s, it a very long time, but I don't want to define a specific time. because the wait time maybe is longer than that. So i think it's better to disable it > > Can anyone tell me is it possible?? and How? > > Thanks in advance! > > Wei. Hi Wei, One thing you can do is send the :DIG command and then loop until the return of *OPC? indicates that the measurement is complete before you send the :WAV:DATA? command to bring the data into MATLAB. In pseudo code snippet: fprintf(tcpipObj,':DIG'); status = query(tcpipObj,'*OPC?'); while ~isequal(str2num(status),1) status = query(tcpipObj,'*OPC?'); end fprintf(tcpipObj,':WAV:DATA?'); % now read data.... HTH, -Vinod
From: Wei He on 17 Jun 2010 13:25 Hi, Vinod, Thanks for your helping-hand! I fixed this problem by your suggestion :) Best Regards~! Wei. "Vinod Cherian" <vcherian(a)mathworks.com> wrote in message <hvb706$d8t$1(a)fred.mathworks.com>... > "Wei He" <Eric.he(a)hotmail.com> wrote in message <hvb20p$pmf$1(a)fred.mathworks.com>... > > Helo, everyone, > > I am using the instrument control toolbox to control an oscilloscope. I need to order the matlab to wait for the oscilloscope to get enough > > I want to know that whether it is possible to disable the timeout in order to wait for the Oscilloscpe?? > > > > the maximal timeout time is 1000s, it a very long time, but I don't want to define a specific time. because the wait time maybe is longer than that. So i think it's better to disable it > > > > Can anyone tell me is it possible?? and How? > > > > Thanks in advance! > > > > Wei. > > Hi Wei, > > One thing you can do is send the :DIG command and then loop until the return of *OPC? indicates that the measurement is complete before you send the :WAV:DATA? command to bring the data into MATLAB. > > In pseudo code snippet: > > fprintf(tcpipObj,':DIG'); > status = query(tcpipObj,'*OPC?'); > while ~isequal(str2num(status),1) > status = query(tcpipObj,'*OPC?'); > end > fprintf(tcpipObj,':WAV:DATA?'); > % now read data.... > > HTH, > -Vinod
|
Pages: 1 Prev: using cd to navigate in and out of directories Next: Help with graphing please |