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 visualizaciones (últimos 30 días)
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).

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 27 de Jun. de 2009
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]);

Más respuestas (0)

Categorías

Más información sobre Introduction to Installation and Licensing en Help Center y File Exchange.

Productos


Versión

R14SP2

Community Treasure Hunt

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

Start Hunting!

Translated by