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)?
1 view (last 30 days)
Show older comments
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).
Accepted Answer
MathWorks Support Team
on 27 Jun 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 Comments
More Answers (0)
See Also
Categories
Find more on Manage Products in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!