Why does accessing the parallel port with the Data Acquisition Toolbox take a much longer time in version 2.6 (R14SP2) than version 2.5.1 (R14SP1)?
2 次查看(过去 30 天)
显示 更早的评论
I am measuring the time it takes to write to the parallel port with the Data Acquisition Toolbox using the following code:
tic
dio = digitalio('parallel','LPT1');
dout = addline(dio,0:3,2,'out');
for i = 1:500
putvalue(dout, [0 0 0 0]);
end
tt = toc
When I execute this code in a loop for ten iterations, I see that the performance is slower in version 2.6 (R14SP2) of the toolbox. The average speed is 1 second in version 2.6 (R14SP2) and 0.1 seconds in version 2.5.1 (R14SP1).
采纳的回答
MathWorks Support Team
2009-6-27
This enhancement has been incorporated in Release 2006b (R2006b). For previous product releases, read below for any possible workarounds:
This is a bug in the Data Acquisition Toolbox 2.6 (R14SP2) in the way PUTVALUE handles the output to a vector of Line objects. A possible workaround, if you are writing values to all the lines of the object, is to write to the DIGITALIO object instead of the vector of Line objects returned by ADDLINE.
For your example, replace this line of code:
putvalue(dout, [0 0 0 0]);
with:
putvalue(dio, [0 0 0 0]);
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!