LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data acquisition..........reading input with execution highlighting

Solved!
Go to solution

I usually still use the DAQmx Timing VI to configure sample clock parameters (you're using just a property node, this can be done but there are a few properties that you haven't set that are important--open up the DAQmx Timing VI to find out which ones).

 

In addition to what is inside the DAQmx Timing call, you should just need to add the single property to each task (replace "Dev2" with the appropriate device):

 

Untitled 21 Block Diagram _2013-06-04_12-54-17.png

 

Best Regards,

John Passiak
0 Kudos
Message 11 of 29
(5,997 Views)

synchronous acquisition2.PNG

 

I made the change but I couldn't find  1.PNG Am I doing something wrong  ?

"but there are a few properties that you haven't set that are important--open up the DAQmx Timing VI to find out which ones"

 

I don't understand which properties I missed. Please elaborate.

 

Regards

Raj

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 12 of 29
(5,992 Views)

The inside of the DAQmx Timing VI looks like this:

DAQmx Timing (Sample Clock).png

 

You'll find that your earlier example is missing SampTimingType, SampQuant.SampPerChan, SampClk.ActiveEdge, SampClkSrc.  I'm not 100% sure which of these are required (SampPerChanel almost certainly is, and I'd expect SampTimingType as well) but to avoid worrying about it I just usually use the timing VI to make things easier.

 

 

Apologies I left this out:  to get PXIe_Clk100 to show up in the drop-down list you'll have to right-click the terminal and select I/O Name Filtering, then make sure "Include Advanced Terminals" is checked.  I just made a rant in the idea exchange about this behavior if anybody is interested:

 

Untitled 1 Block Diagram _2013-06-04_16-00-17.png

 

 

Best Regards,

John Passiak
0 Kudos
Message 13 of 29
(5,982 Views)

you are very detailed in your answers this is amazing, I won't be able to check till I go back in the lab day after tomorrow. In the mean time I would like to know which book do you follow ? do you have any suggestions ? I would try to see if this solution works on thursday. 

 

Best Regards

 

Raj 

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 14 of 29
(5,978 Views)

2.PNG3.PNG

 

 

I made the above changes and I am not getting the required result still. Can you tell me what am I doing wrong ?

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 15 of 29
(5,947 Views)

The "Samples per Channel" input of DAQmx timing is unwired on both the AI and AO tasks.  The default is 1000 samples.

 

On the AO Task (@ 2 MHz) the 1000 samples will only be 500 us (.0005 seconds).  Since you're generating a 1V, 10 Hz sine wave, the voltage at .0005 seconds should be pi/100 (.0314...).  The AI task (@ 250 kHz) would acquire 4 ms of data, but most of this is after the AO task has completed.  The graph you have shown reflects this.

 

 

The other thing I notice is that the signal appears to be floating--do you have AI 2- (aka AI 10, pin 31 on the 6221) connected to AO GND from the 6361?  Or you could alternatively try RSE mode on the input so the measurement will be taken relative to the ground of the 6221.

 

 

Best Regards,

John Passiak
0 Kudos
Message 16 of 29
(5,928 Views)

5.PNG

 

 

6.PNG

 

 

Now I am getting above data, it looks good but I have some following questions ?

 

1. Do you agree that I am not missing any data and the signal is fully synchronised ?

2. What is Dev1/PXIe_Clk100 and Dev2/PXI_Clk10 represents and what is their function ?

3. In your previous post "the voltage at .0005 seconds should be pi/100 (.0314...)." how did you calculate that ?

 

Best Regards

Raj

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 17 of 29
(5,906 Views)

Hi Raj,

 

Keeping my answers short this time:

 

1.  Yes

2.  These are clocks on the PXI backplane--see here.

3.  The link shows how I calculated it.  V*sin(angle).  Angle in radians is 2 * pi * current time * frequency.  Although... I was assuming 1V for the amplitude, it looks like you're generating at 1.2V?

 

 

Best Regards,

John Passiak
0 Kudos
Message 18 of 29
(5,903 Views)

thanks for being fast I just noticed that I changed the rate at dev1 to 250ks/s and also that number of samples to 250k samples because i talked to someone at technichal support yesterday and they mentioned that it is impossible to achieve synchronisation when I am generating at 2Ms/s and reading at 250Ks/s. 

 

 

7.PNG

8.PNG

 

 


Do you still agree that the signal is synchronised with output ?

 

 

 

Rajnikant Singh
Iowa State University (Research Assistant)

0 Kudos
Message 19 of 29
(5,894 Views)

I'd say they are still synchronized since the clocks will not drift relative to one another and they are starting at the same time.  NI's own training and documentation (this article comes to mind) often refer to synchronization at different rates so I am surprised somebody from NI would make this claim.  Sharing a sample clock is just one way to synchronize devices but it is by no means the only (or best) way.

 

However, you have asked a few times now if the tasks are indeed synchronized.  Perhaps you have some other definition of synchronization or some other expectation of what behavior to expect?  I'm assuming your end application isn't just to generate and measure back a sine wave so perhaps there is some other consideration I'm not aware of.  

 

At the rates you are using (250 kHz AI, 2 MHz AO) you will acquire one sample for every 8 samples generated.  The AI samples will always occur at the same time relative to the AO sample clock.  This fits my definition of synchronization, but if you're asking about something different you'll have to be more specific.

 

 

Best Regards,

John Passiak
0 Kudos
Message 20 of 29
(5,878 Views)