Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Using the cDAQ 9139 chassis sample clock with 9234 9235 and 9237 cDAQ modules

We are building systems using cDAQ-9139 chassis and 24 bit cDAQ 9234, 9235 and 9237 modules. The number and type of modules vary depending on the application. We normally use MAX to configure a Task which we then access and run using application code written in C#/.NET4 4.5/DAQmx.

 

When all the modules in a chassis are identical then we can use the 12.8 MHz or 13.1072 MHz clocks in the modules to set the sample rate.

When the modules in a chassis differ then by default DAQmx defaults to one of the 13.1072 MHz clocks and this often does'nt give us the sample rates we require (and prefer) from the 12.8MHz clock.

 

Ideally we need to set a sample rate common to any mix of modules in a chassis. From reading the manuals on the chassis and modules it would appear that we should be able to use the sample clock in the 9139 chassis and configre all the modules to use this external clock and then set their internal sample rate dividers appropriately to give a common synchronised sample rate. What's not clear to me is how to perform this type of configuration either in the Task using MAX or programmatically in the C# application code.

 

Any help in the accomplishing this would be appreciated!

 

Malcolm Sharp      

0 Kudos
Message 1 of 9
(6,735 Views)

Hi Malcolm

So I'm I right in saying that when the 9234, 9235 and 9237 modules are in the cDAQ you can use the 12.8 MHz clock but when you had another modules for another part of your program you lose the 12.8 MHz clock and it goes to the 13.1072 MHz clock.

 

Let me know if I have that right.


Regards

James

0 Kudos
Message 2 of 9
(6,687 Views)

 Hi James,

 

Let me clarify. I'm wanting to run one task from one 9139 chassis containing a mix of 9234, 9235 and 9237 modules. When I use the 9235 or 9237 modules which both have a 12.8 MHz internal sample clock (alone or in combination) in the 9139 chassis then the .NET Daqmx "configureSampleClock" method in my C# application allows me to select sample rates that are divided off the 12.8 MHz clock. When I add a 9234 which has a 13.1072 MHz internal clock to the chassis then the "configureSampleClock" method allows me to select sample rates divided off the 13.1072 MHz clock. I read somewhere that DAQmx always defaults to selecting the highest frequency clock available in this situation and I'm cool with that as a default.

 

However the sample clock rates available off the 13.1072 MHz clock aren't really amenable to the acquisition and analysis I'm doing and I'd prefer to use some other source that would provide the sample rates I need. Now the sample clock (and associated dividers) in the 9139 chassis are another viable source and would give me these sample rates. The 9234, 9235 and 9237 also advertise as being able to be operate off an external clock. So my problem is how do I configure all the 9234, 9235, 9237 modules to connect their external clock lines to the 9139 chassis sample clock output, set their internal dividers, and set the main sample rate in the 9139 so I can use that as the task clock for my application. I can't manage it in MAX when I set up the task initially and I can't seem to find the correct set of .NET DAQmx method calls to do it in C#.

 

Any help in getting this type of configuration working would be appreciated!

 

Regards,

 

Malcolm

0 Kudos
Message 3 of 9
(6,682 Views)

Hi Malcolm do you think you could add a few screen shots of your MAX task so I can see how it is setup.

 

Thanks

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

Hi,

 

The actual hardware is in use for the next couple of weeks but I've simulated what I'm seeing using virtual hardware in MAX. The virtual hardware and actual hardware show the same problems

 

With a 9139 chassis and one 9234 and one 9237 what I'm seeing is:

 

1. MAX will let me set any sample rate I want but by setting the "N samples" acqusiiton mode and then setting the "Samples to Read" and "Rate (Hz)" parameters to the same value (which should give a display of exactly 1.0 seconds of data) the only sample rate that give the correct results are those that are provided by the 13.1072 MHz clock and the divider chain in the 9234 right down to 1652 S/s. Going lower if i set MAX to give me 1652 samples of data at 391 S/s from the 9234 then I still get 1 second of of data, not the 4.225 seconds I'd expect, i.e. MAX isn't switching to the using  9139 chassis clock to get me the lower sample rate but is 'stuck' at the 1652 S/s minimum it can generate from the 9234. This is consistent with what I see using the .NET "configure SampleClock" method programmatically.

 

If I go to the Advanced Timing Tab in MAX and set any of the fields "Sample Clock Type", "Timing Engine" or "Clock Source" to other than the default "Internal" and "<Let NI-DAQ choos>" I get an error and the acquisition won't start.  

 

Looking at the specification for the 9234 I read...

 

Internal master timebase (fM)

Frequency ...................................13.1072 MHz

Accuracy.....................................±50 ppm max

Data rate range (fs) using internal master timebase

Minimum....................................1.652 kS/s

Maximum................................... 51.2 kS/s

Data rate range (fs) using external master timebase

Minimum....................................0.391 kS/s

Maximum................................... 52.734 kS/s

  

and for the 9139 chassis for signma-delta modules...

 

The oversample clock is used as the AI Sample Clock Timebase. While

most modules supply a common oversample clock frequency (12.8 MHz),

some modules, such as the NI 9234, supply a different frequency. When

sigma-delta modules with different oversample clock frequencies are used

in an analog input task, the AI Sample Clock Timebase can use any of the

available frequencies (my italics); by default, the fastest available is used. The sampling

rate of all modules in the system is an integer divisor of the frequency of

the AI Sample Clock Timebase.

 

So it appears that the 9234 is capable of  running with an external sample clock at frequencies lower that 1652 S/s AND that the AI sample clock circuitry in the 9139 is capable of generating these lower sample rates. If MAX (and the .NET interface to DAQmx) don't make the connections to do this automatically how do I get it to do this explicitly in MAX or programmatically in C#? 

 

Regards,

 

Malcolm

0 Kudos
Message 5 of 9
(6,647 Views)

Hi Malcolm

I would have a look at this document, just to make sure the sample rates you want are possible

 

http://digital.ni.com/public.nsf/allkb/593CC07F76B1405A862570DE005F6836?OpenDocument

 

As both cars have delta-sigmal ADC one card should take the role of the master timebase and I belleve as you mentioned it should be the faster one.

 

Hope that helps

 

Regards

James

0 Kudos
Message 6 of 9
(6,562 Views)

Hi James,

 

The document you referred me to does explain how the NI software selectes the default clock source and resulting clock rates with a mixture of 9234, 9235 and 9237 modules in a cDAQ chassis. This is the behaviour I'm describing in my previous posts. The problems is that I don't want the default behaviour. I want to be able to set the clock source myself.

 

Ideally I'd like to use the sample clock in the 9139 chassis or alternatively the lower freguency clock source in from a 9235 or 9237 module if fitted. You can do it as the document you referenced shows how to change the clock source in LabView...

 

Snippet:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

You can, however, force the task to use any of the available timebases by manually setting the Sample Clock Timebase Source property using the DAQmx Timing property node.

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
Can this 'wiring' be performed when setting up the task in MAX? Alternatively I want to be able to do the same thing when setting up the Task in a .NET environment from a C# application as we don't use Labview. In this latter case what are the DAQmx calls that would allow me to 'wire' the DAQmx task timing to the clock source I want?
 
Thanks again for your assistance.
 
Regards,
 
Malcolm
0 Kudos
Message 7 of 9
(6,532 Views)

I beleve this white paper should help you

http://www.ni.com/white-paper/5409/en/#toc4

 

the section called Configure the Timing Parameters. it has a few .net examples

Regards

James

0 Kudos
Message 8 of 9
(6,449 Views)

Thanks James, I'll read the examples and give the analogInTask.Timing.ConfigureSampleClock( ...) example a try to see if I can get it to accept a timing source other than the default.

 

Regards,

 

Malcolm

0 Kudos
Message 9 of 9
(6,446 Views)