From: Ali sohaib on
I Am Using NI-USB6501.

I am trying to get an output pulse of 100Hz and 5V form USB-6501.
The maximum I am getting is 10Hz.

I changed the output of a pin in a continuous for loop from 0 to 5v (without any delays) and the maximum freq I get is 10Hz.

I tried precise timming by using the timer function and I toggeled the output pin after every 0.001 sec and still the output was 10Hz. Even if I decrease the time period for the timer fcn still I dont get above 10.5Hz.

the code is:

dio=digitalio('nidaq', 'Dev1');
addline(dio, 0:23, 'out');

for i=0:500
putvalue(dio.Line(9:16), [1 1 1 1 1 1 1 0])
putvalue(dio.Line(9:16), [1 1 1 1 1 1 1 1])
end

and by using other method i.e timers

t = timer('TimerFcn',{@abctimer, dio}, 'Period', 0.001,'TasksToExecute', 500,'ExecutionMode', 'fixedRate');

and I toggle the pin in abctimer fcn.
its the same...doesn't go above 10Hz..
I tried both fixedrate and fixeddelay...but no change