Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI C-DAQ synchronization

Hi,

 

I have used a NI 9205 for reading sensors signal in voltage, a NI 9401 for reading the speed information from an encoder, and a NI c-DAQ 9178 (chassis).  The purpose is to synchronize the frequency from NI 9401 with the sampling rate of NI 9205, Which is to set the frequency output of NI 9401 as the sampling rate of NI 9205 real time. So the way I programmed by Labview is to use the frequency output of NI 9401 as the input of 'source' of DAQmx Timing.vi for NI 9205, through the PFI terminal of NI c-DAQ 9178. The sample mode is continuous samples. 25 channels are used in NI 9205.

 

The problem I have and could not explain is:

1. when the frequency from NI 9401 is lower than 160hz, for each channel of NI 9205, the number of samples acquired/s by NI 9205 is about the half of frequency;

2. when the frequency gets higher, the number of samples acquicred/s is increasing, but less than the half of frequency;

3. the number of samples acquired/s reaches the highest (about 103 samples/s) at the frequency around 360-370hz;

4. the number of samples acquired/s decreases from 103 samples/s when the frequency continuous to increase.

 

Could anyone help to explain this situation? The sampling rate matters in my measurement. Is it not supposed to be equal to the frequency output from NI 9401? Any words will be appreciated!

 

Jingjin  

0 Kudos
Message 1 of 9
(4,093 Views)

Does anyone have any idea about this problem? I have to figure it out soon...

0 Kudos
Message 2 of 9
(4,077 Views)

Hi Jingjin

 

I do not understand quite well your application or your problem.

 

Why do you want to generate that signal in one module to connect it to the cDAQ PFI line.

 

How are you generating that signal?

 

Could you attached some screen shoot or images of your code errors?

 

Use VI Snippet to Store and Share Reusable Code Sections

 

Regards

Esteban R.

0 Kudos
Message 3 of 9
(4,063 Views)

Hi Esteban R.,

 

Thanks for your attention!

 

My system is designed to collect field data during movement. The idea is to have constant spatial measuring resolution. Since the speed of the  vehicle could not be controlled as the same all the time manually, the solution I came up is to syschronize the sampling rate of the NI 9205, which is used to collect the field data, with the frequency output of the NI 9401, which is connected to an encoder measuring the speed of the vehicle. So in that case, if the vehicle is driven faster, the system collects data faster, and if it is driven slower, the system collects data slower. Hope this makes sense to you.

 

There was no error code generated. It  works. But like I said in my first post, the actual sampling rate was just half of the frequency of the encoder at low frequency range, and it was getting worse when the frequency increased, and it could not exceed 103 hz no matter how high the frequency was. Do you have any idea about this situation? Thanks!

 

P.S.. I've attached the block diagram.

 

 

 

 

The best,

Jingjin 

0 Kudos
Message 4 of 9
(4,054 Views)

Hi Jingjin

 

In that case you have thought about changing the sample rate dynamically instead of trying to synchronize both devices.

Here is a link with more information.

 

How Can I Dynamically Change the Sampling Rate of a DAQ Assistant?

 

But as a recommendation you might use a state machine in order to start, acquire and stop the task, so in order to change the sample rate you could have some conditions that way you won’t start and stop the task every cycle.

 

Regards

Esteban R.

0 Kudos
Message 5 of 9
(4,045 Views)

Hi, Esteban R.,

 Thanks for your link. But it seems not the solution I was looking for. It needs to change sampling rate by inputing the vaule dynamically. While I still need to change the sampling rate according to the frequency of the encoder real time. Is there any explaination for the situation that the sampling rate of the NI 9205 only gets half of the external source of the sample clock?

 

The best,

Jingjin

0 Kudos
Message 6 of 9
(4,040 Views)

Hi Jingjin

 

Have you try with some other type of task to measure the frequency.

Here is one of the examples of NI that measure frequency. The example is in LabVIEW 2011 if you have an older version of LabVIEW let me know to upload the example in an older version.

 

Regards.

Esteban R.

0 Kudos
Message 7 of 9
(4,001 Views)

Hi, Esteban R.,

 

I have the 2010 version. Could you upload the example in this version? Thanks!

 

Jingjin

0 Kudos
Message 8 of 9
(3,996 Views)

Hi Jingjin

 

Here is the code for LabVIEW 2010

 

Regards 

Esteban R.

0 Kudos
Message 9 of 9
(3,979 Views)