Hi, I have integrated the USB845x using python ctypes to use the DIO. I want to output a single pulse with the length of 10 microsecond. However, I am able to do it with the minimum length of 250 microsecond using the C API. Maybe there is a overhead of using python to access the NI USB845x. Is there a specific code to make sure it pulse maximum of 10 microsecond?
Here is my code for the python DIO pulse:
portNum=0
lineNum=0
writeData=1
offData=0
check_error(ni845x_dll.ni845xDioWriteLine(dev_handle,portNum, lineNum, writeData))
# time.sleep(0.00001)
start=time.perf_counter()
while (time.perf_counter() -start) <10e-6:
pass
check_error(ni845x_dll.ni845xDioWriteLine(dev_handle,portNum, lineNum, offData))
I have tried time.sleep and even run it without both type of delay. The smallest will still be 200+ microsecond.
Thanks in advanced.
I have tried time.sleep and even run it without both type of delay. The smallest will still be 200+ microsecond.
Thanks in advanced.