10-27-2017 08:55 PM
Actually, i need to read the logic state of a counter output using the same device. if i create the pulse manually using elapsed time, the period of the output is not the same as i wanted even just 1 ms. i need to create 10 us period of the pulse. if i create the pulse using the counter output, i can get that 10 us period. But, i cannot get the logic of the output that i need. is it possible to read the logic of the counter output internally, without using any jumper on the channel of the device? how should i do? or if i have to, will it damage the device?
i'm using ni usb-6218 for the device
10-28-2017 04:26 AM
You will not be able to achieve that (and with that I refer to your thread title) with a USB-6218. You can not programm any DIO-tasks with a hardware timing with that card. Only software timing is possible. Hence - as you alread realized for yourself - you can only achieve a resolution of about 1 ms when using a Digital-Out task.
The same is then valid for a Digital-In Task, only software timing is possible and hence a resolution of about 1 ms, way to big for your 10 µs pulse.
What you could do is to measure your pulse with the analog-in of that card. But be aware, the max. aquisition rate is 250 kS/s resulting in a minimal time resolution of 4 µs.
Regards, Jens
10-30-2017 11:56 AM
I'm not sure if you can directly do the thing you're trying, but if we take a step back to consider the *reason* you want to read the output and identify what you plan to do next, I suspect you'll be able to achieve your end goal.
First you're right that you need to use a counter to generate a 10 usec pulse, you can't do it with software-timed digital output. The big question is why you want to read that output signal via digital input? How would you respond to that information? What would you do next? There are many possible options, but the right choice very much depends on some further info you haven't described yet.
Another thing: does your program only need to generate and react to 1 pulse? Or will this happen repeatedly? If repeatedly, what are the timing requirements?
-Kevin P