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 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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).
Réponse acceptée
MathWorks Support Team
le 27 Juin 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]);
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!