xukeuniversal
2007-12-28, 08:20
我现在波特率用115200,8000字节触发一次event。就是g.ByteAvailableFcnCont=8000,也就是说1000个数据画一次图。
但我算了一下,我现在一秒钟可以传出来将近4000个数,但为什么matlab主空间里显示的是每两秒触发一次instrcallback函数?而应该是一秒钟至少触发三次阿。
.M文件部分设置:
scom.OutputBufferSize=10000;
scom.InputBufferSize=10000;
scom.BaudRate= 115200;
scom.ReadAsyncMode='continuous'
scom.BytesAvailableFcnMode='byte';
scom.BytesAvailableFcnCount=8000;
scom.BytesAvailableFcn=@instrcallback;
主space部分显示:
BytesAvailable event occurred at 11:49:50 for the object: Serial-COM1.
BytesAvailable event occurred at 11:49:52 for the object: Serial-COM1.
BytesAvailable event occurred at 11:49:54 for the object: Serial-COM1.
BytesAvailable event occurred at 11:49:56 for the object: Serial-COM1.
BytesAvailable event occurred at 11:49:58 for the object: Serial-COM1.
BytesAvailable event occurred at 11:50:00 for the object: Serial-COM1.
BytesAvailable event occurred at 11:50:02 for the object: Serial-COM1.
BytesAvailable event occurred at 11:50:04 for the object: Serial-COM1.
BytesAvailable event occurred at 11:50:06 for the object: Serial-COM1.
BytesAvailable event occurred at 11:50:08 for the object: Serial-COM1.
还请高手指点。感谢!
但我算了一下,我现在一秒钟可以传出来将近4000个数,但为什么matlab主空间里显示的是每两秒触发一次instrcallback函数?而应该是一秒钟至少触发三次阿。
.M文件部分设置:
scom.OutputBufferSize=10000;
scom.InputBufferSize=10000;
scom.BaudRate= 115200;
scom.ReadAsyncMode='continuous'
scom.BytesAvailableFcnMode='byte';
scom.BytesAvailableFcnCount=8000;
scom.BytesAvailableFcn=@instrcallback;
主space部分显示:
BytesAvailable event occurred at 11:49:50 for the object: Serial-COM1.
BytesAvailable event occurred at 11:49:52 for the object: Serial-COM1.
BytesAvailable event occurred at 11:49:54 for the object: Serial-COM1.
BytesAvailable event occurred at 11:49:56 for the object: Serial-COM1.
BytesAvailable event occurred at 11:49:58 for the object: Serial-COM1.
BytesAvailable event occurred at 11:50:00 for the object: Serial-COM1.
BytesAvailable event occurred at 11:50:02 for the object: Serial-COM1.
BytesAvailable event occurred at 11:50:04 for the object: Serial-COM1.
BytesAvailable event occurred at 11:50:06 for the object: Serial-COM1.
BytesAvailable event occurred at 11:50:08 for the object: Serial-COM1.
还请高手指点。感谢!