01-28-2013 01:15 PM
is there a way to achieve synchronization without sharing sample clock rates ? I want to dev1 and dev2 to start reading at the same time so there is no phase difference between the two.
01-28-2013 01:19 PM
The definition of synchronization is that each sample is taken at the same time. This requires sharing a start trigger as well as a sample clock.
However, if you don't want synchronization, but just want to start sampling at the same time, all you have to do is share a start trigger.
Leah
01-28-2013 01:41 PM
Please take a look at the code and the pics I am attaching. I have set the rate to 250ks/s for all the devices because I want synchronization. When I increase the frequency the I am losing data, can you tell me how to avoid this. One pic has frequency set to 20Hz and other with lost samples is 100Hz.
01-30-2013 08:01 AM
Are you saying that the signal that you are measuring is 20 Hz and 100 Hz? What do you mean by losing data? Do you mean that your acquired waveform isn't perfectly sinusoidal? Or do you think that you aren't really sampling at 250 kS/s?
Leah
01-30-2013 12:28 PM
First I am acquiring 20Hz signal which works fine, but when I increase the frequency to 100 Hz the signal does not look like a sine wave instead it looks aliased. I believe that I am generating at 250kS/s and also acquiring at 250kS/s. I attached my code for you to look at, please let me know what am I missing?
01-30-2013 12:47 PM
Wow you are really confusing us here. But I think the problem is exactly what you have written: You are aliasing your signal.
01-30-2013 01:06 PM
Judging by the time axis from your graph, I don't think that you are measuring a 20 Hz or 100 Hz sine wave. It looks like the wave you are measuring is about 25,000 Hz. Since this is the case, the output that you are seeing is expected for your sample rate. I don't think that you are losing samples.
To get a "smooh" representation of your sine wave, you would need to sample at about 15 times the frequency of the signal you are trying to measure.
Leah
01-30-2013 02:14 PM
thanks for clearing it out, it was helpful. I am a software engineer I totally missed this:). Now, I am having confusion in understanding how the rate and samples per channel of daqmx timing vi. works. The way I understand is that to generate a sine wave of frequency 100Hz with sampling rate of lets say 500 samples/s means that there would be 500 samples per 100 cycle which interprets into generating 5 samples/cycle. Am I right over here ? and two generate two cycles I would have to generate 10 samples and so on. Please clarify this, this is getting really confusing to me. Ultimately I want to be able to control the number of cycles to pass through a ferromagetic material which is a part of my project.
01-31-2013 10:09 AM
Samples per channel specifies the number of samples to acquire or generate for each channel in the task if sample mode is Finite Samples. If sample mode is Continuous Samples, NI-DAQmx uses this value to determine the buffer size.
I found this document in the DAQmx help file that explains this.
http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/buffersize/
Leah
01-31-2013 10:46 AM
According to the block diagram attached, how many cycles should be generated according to you ? I am getting 3.5 cycles generated.