01-16-2011 09:20 PM
I am using PCI6250 card and Measurement Studio (VC++). I used a data acquisition routines (from one of the NI examples) to continuously acquire data (6 channels) triggered off the TTL line (PFI-1). The twist is that I need to read data from the USB port every time that the TTL line triggers. This data is the independent distance wheel. So after each trigger, I read the USB data in the ::OnEvent routine. This works as long as the data acquisition is slow. However in the case of fast data acquisition, I do not get the return back (in ::onEvent) until the data acquisiton is done (which sometimes after a many triggers) and the USB data (distance wheel) are not correct. Is there anyway we can incorporate USB port reading into the data acquistion thread?
Thank you,
Yajai
01-17-2011 10:16 AM
DrObb,
It is not likely you will be able to synchronize your USB port readings with your DAQ readings if you are sampling at a fast rate. It sounds like you plan is to trigger the USB port reading through software. Are you just reading a signal that is already waiting on the port? Or do you need to tell the USB device to send the signal first? It is generally not recommended to use USB device if you want to do any kind of synchronization. Additionally, you will run into further complications when pairing that with software timing (which is very inaccurate unless you are using a realtime system). What sort of readings are you trying to synchronize?
01-17-2011 03:35 PM
Data from the USB port is waiting to be read (it came from a separate source - it is a counter of the distance wheel). I need to read this data whenever the data acquisition occurs so I know the correct distance associating with the waveform data. So would it be possible to read digital I/O port on the NI card either with a counter or a PIO line (synchronize with data acquisition)? If this is possible, we can wire from the port to digital I/O line.
Thanks,
Yajai
01-19-2011 12:37 PM - edited 01-19-2011 12:38 PM
Can you please clarify what USB device you are using?
Best regards,
Ali M
Applications Engineer
National Instruments
01-19-2011 12:59 PM
01-20-2011 03:12 PM
DrObb,
Can you use the counters on the 6250 for your distance encoder? If you are taking the measurements on the same card it will be much much easier to synchronize the two measurements.