02-12-2007 08:17 AM
02-12-2007 10:54 AM
02-12-2007 11:41 AM
Thank you Randall
sounds like a good idea but the problem is that I don't know which of them will triger first. Eventually I will use 7 switches and I need to find out the order of triggering and the time between them. I also have a CompactRio but I thought that with the usb device I will speed the things up. Now I'll have to figure out how to design the application for the cRIO.
Any advice will help
regards
02-12-2007 12:41 PM
02-14-2007 05:37 AM
Hi Mugur,
I can think of three ways to approach your problem. The most accurate and reliable approach would be to use your compactRIO with a digital input module. This approach can be a little complicated unless you are already familiar with FPGA programming and its timing concepts. The second most accurate way would be to use analog input with hardware timing with your USB-6009. This approach would be similar to Randall's suggestion. Both of these ways are ensured to meet your 1 kHz sample rate (1 ms period) requirement.
The least accurate way is to use digital input on your USB-6009. This is because the USB-6009 cannot do hardware-timed digital input. However, I made an example of doing it this way just because it was simple to code up and I was interested in finding out how fast I could do software-timed digital input on USB DAQ devices. My code samples seven digital channels and whenever a channel goes low (switch triggered) it makes a timestamp and remembers the index of the channel. You can easily get the time difference between triggered switches by comparing the timestamps.
I tried my code on a USB-6008, and I could get slightly less than a 1 kHz sample rate (about 900+ Hz). This might not be sampling fast enough for you but maybe my code can give you some ideas about how to implement the other approaches.
Let me know if you have any questions about my code or if you need any more help.
Way S.
NI UK Applications Engineer
02-14-2007 07:37 AM
02-14-2007 07:44 AM