01-14-2010 06:57 PM
Hi KingLai,
Could you post your code? It sounds like you aren't reading data from the PC Buffer fast enough, you could remedy this by increasing your loop rate or by reading more samples per loop. You also might want to increase your buffer size.
Something else to keep in mind is that technically the 6259 is only specced up to 10 MHz for digital inputs.
Best Regards,
01-18-2010 06:01 PM
Hi John,
Sure, this is my code. I appreciate your help.
Best Regards,
King
01-19-2010 09:10 AM
Hi King,
There are a couple of issues with the way this task is configured:
1. The While Loop is only reading back 1 sample per iteration. DAQmx Read is the function that pulls data from the buffer.
This is going to be problematic since the data is coming in so quickly. At 10 MHz you would be clocking data into the buffer every 100 ns. The loop is going to execute on the order of ms, so the buffer is going to fill up rather quickly if you are only pulling one sample from the buffer every iteration. The rate at which data is pulled from the buffer must be equal to the rate at which it is coming in to prevent an overflow.
To remedy the situation, simply change the DAQmx Read instance to read back Multiple Samples per loop iteration. For example, if you specify to read 1M samples per call to DAQmx Read, the loop would only have to run 10x per second (if the data was coming in at 10M).
2. The Buffer size will default to 10000 samples for Change Detection tasks. To increase this, you may wire a higher number to the Samples Per Channel input of the DAQmx Timing.vi. I suggest to increase the buffer size to 5M samples if possible.
I hope this helps, if you have any questions about this let me know.
Best Regards,
01-20-2010 03:26 AM
Hi John,
Thank you for your suggestion.
I have two questions,
1. Is it possible to increase the while loop to the order of ns?
2. Based on my current code, will the data store into the buffer every time when the "change detection" occurs? If I read 1000 data in each while loop, is it mean they are the 1000 data after each SYNC signal?
Thank you so much.
Best Regarsds,
King
01-20-2010 10:21 AM
Hi King,
1. Is it possible to increase the while loop to the order of ns?
No. The rate of the loop itself is processor dependent but it will probably fall in the ms range. Why would you need to run the loop this fast?
2. Based on my current code, will the data store into the buffer every time when the "change detection" occurs? If I read 1000 data in each while loop, is it mean they are the 1000 data after each SYNC signal?
I'm not sure that I follow--change detection means that you will take a sample every time one of the inputs changes that you have selected when you configure the change detection.
To help clarify, the system would look something like this:
So... the data is being clocked into the onboard FIFO of your DAQ card (it will clock itself in based off of the lines that you have selected for change detection). The data is then transfered over to a reserved space in your Computer's memory. This is the DAQmx Input Buffer--it is a finite size and will overflow if you do not read from it fast enough--you can make this buffer larger but if you are clocking data to it faster than it is being read you will receive the buffer overflow error. Once you pull the data into LabVIEW memory you can do whatever you like with it (e.g. Write to File).
Best Regards,
05-31-2011 08:32 AM
Hi everyone,
i am trying to built up an lowfield nmr spectrometer. And now I have to decouple two coils (transmit and receive coil by TTL Pulses). So I have to correlate one analog signal (RF-Puls) TTL-Puls1 for grounding the receive coil and TTL-Puls2 for grounding the transmit coil. And finally the aquisition of the NMR-signal after the pulse. The aquisition should start right after the end of the pulse. This timing must be working in microseconds. Milliseconds is not sufficient for NMR.
I attached a figure which tries to show the devolution of the events.
So how can I synchronize or correlate those events in microseconds ? Any ideas or suggestions ?
In a first step I have already synchronized the begining of the pulse and detection. And then I implemented a delay. So I could start the detection right after the pulse, but now I don't know how to implement the TTL-pulses in this configuration.
To solve this problem would be very important for my project.
Thanks very much
Rob
I am also using USB-6251 BNC. Labview 7.1 and 8.0.
06-01-2011 06:49 PM
The timing you are trying to achieve is not quite clear. So you want TTL pulse 1 to by synchronized with the RF Pulse and TTL 2 pulse be synchronized with the ADC acquisition (if you could show this in terms of each clock represented in a stacked plot with some timing numbers, it might help to clarify)? Either way, you might need a device that is meant for higher speeds due to the fact you are using RF.
Thanks,
Sean Newton
06-06-2011 04:00 AM
Hey Sean,
thanks for your reply. So I think you understood it well. Firstly I want to synchronize the the rf-pulse with the TTL-pulse 1. Actually the TTL-pulse 1 (grounds receive coil) should be on true as long as the rf-pulse ( 80 microseconds) is on . When the rf-pulse ends the TTL 1 should also end and the TTL 2 (grounds transmit coil) and the aquisition (detect NMR-Signal) should start immeadiately at the same time.This all should happen in micrseconds in the best case and to 1- 8 ms in the worst case.
So what I reached so far with my program is that I synchronized the rf-pulse with the aquisition by a trigger. They start at the same time ( I use the internal 80 MHZ clock) but I can led the aquisition start with a delay (delay is adjustable). Is it possible to synchronize those for tasks with my equipment ?
Can I use the same clock for the other tasks ?
May be I can adjust my assembling to use only a duplexer then I would need one TTL-pulse ? But now I want to try it with two coils.
Thanks again for your help
Rob
06-07-2011 11:07 AM
Rob-
Yes you can export this clock for use with other tasks. There are a few ways to do this. Refer to the M-series User manual: http://www.ni.com/pdf/manuals/371022k.pdf . Chapters 8 and 9 discuss the PFI lines and Digital Routing and Clock Generation. This will help you with exporting the clock. Also, there are examples in the LabVIEW example finder. The ones you may be interested in are located in: Find Examples>>Hardware Input and Output>>DAQmx>>Synchronization>>Multifunction or Multi Device. These references should be what you need to route your clock and synchronize your devices. Hope this helps!
Thanks,
Sean
06-24-2011 07:03 AM
Hey Sean,
thanks for your help again. But I am still trying to get the timing right. May be you can help me if you see my program.
Thanks
Rob