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
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 个)

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品


版本

R14SP2

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by