| Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) | 
![]()  | 
	
| 		
			
			 | 
		#1 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2007-12-08 
				
				
				
					帖子: 2
				 
				
				
				声望力: 0 ![]()  | 
	
	
	
		
		
			
			 
			
			我现在波特率用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. 还请高手指点。感谢!  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#2 | 
| 
			
			 普通会员 
			
			
			
			注册日期: 2007-12-02 
				
				年龄: 44 
				
					帖子: 74
				 
				
				
				声望力: 19 ![]()  | 
	
	
	
		
		
			
			 
			
			改变这个参数scom.BytesAvailableFcnCount=8000,试试
		 
		
		
		
		
		
		
		
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 		
			
			 | 
		#3 | 
| 
			
			 初级会员 
			
			
			
			注册日期: 2008-01-23 
				
				年龄: 43 
				
					帖子: 7
				 
				
				
				声望力: 0 ![]()  | 
	
	
	
		
		
			
			 
			
			4000*2=8000就是2秒触发一次呀.是对的
		 
		
		
		
		
		
		
		
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 |