LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interval Vs Round robin scan - how ?

1. The NI Knowledge base document 1DAIG7W3 "Interval Scanning versus Round Robin scanning " explains the procedure. But how does one implement it actually ? ( I have an application to acquire 1000 samples each of 8 channels at a 20 kHz rate. The card is a PCI 6229 card and code done on LV8.0.)

2. While working with circular buffers for analog inputs, if I were to ignore buffer overwrites then I am supposed to set the "OverWrite Mode" attribute. How do I do it ? I am unable to locate this property node ?

Thanks

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 10
(5,406 Views)
I know that E-series devices use interval scanning and not round robin scanning. So my guess is M-series too uses interval Scanning. Now for your application I guess using a Finite samples acquisition with 20KHz sampling rate and 1000 samples to read will be just fine, isn't it?
 
To get the over write mode, drop a DAQmx read property node and select the overwite property.
BR
0 Kudos
Message 2 of 10
(5,393 Views)
Hi Anu,

Thanks for the tip on the DAQMX Read property node. I got it.

I know that for my application the default method of scanning is woking fine. But I still do have some minor value overlap between channels, and I want to be sure that I am doing a Round Robin scan to increase the interchannle delay. Still not sure how to do it ?

Another thing that I would like to know is the relationship between the acquired sample and the space is needs to be stored - so that I can configure the buffer myself optimally. In my case for a sample rate of 20KHz , LV allocates 100K buffer and I feel its way too high.

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 3 of 10
(5,365 Views)
What I wanted to say is that I it may not be possible to do round robin scanning with an M-series card, but i am not sure...
 
In case you want to increase the interchannel delay, you might consider setting the AI Convert Clock rate. You can set this from the DAQmx Timing Property.
 
Having said that, I really don't feel that what you may be seeing is caused due to the overlap between channels. 20kHz on 8 channels is not near the maximum rate of the card, hence the default convert clock rate should be just fine in this case.
 
How did you conclude that there is a overlap between channels?
 
 
BR
0 Kudos
Message 4 of 10
(5,344 Views)
 

Hey Raghunathan,

You can increase the interchannel delay using a property node. Please see this KB for some great details on doing this. Doing this you can achieve round-robin sampling by dividing the time between scans into equal sections.

How do I Increase Interchannel Delay Using NI-DAQmx or Traditional NI-DAQ (Legacy)?
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019NFQSA2&l=en-US

Also, you questions about how DAQmx allocates buffer space are answered in the KB below.

How Is the DAQmx Buffer Size Allocated for a Finite or Continuous Acquisition?
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P9PkSAK&l=en-US

 
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 5 of 10
(5,325 Views)
Hi Cris,

The document on setting the interchannel delay was the one I was looking for. Thanks.

As to  the second doc. on buffers, I already have seen and read it many times over ! But I am still keen to know the actual utilization of the allocated buffer - and this will be possible if I know the actual bytes that each sample takes up. I know that this is kind of "inside information"  which many may not need to know.  Just wondering if there was a way to know that...

Regards

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 6 of 10
(5,305 Views)
Hey Raghunathan,

We set the Buffer Size in units of samples because it makes it easier for customers to understand. The actual number of bytes that each sample takes up depends on the data type that you have selected. For example, if you use a U16 data type, this will take up 2 bytes.
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 7 of 10
(5,281 Views)
Hi Cris,

Its clear now. Thanks.

( Infact it had slipped my attention that the buffer size unit is "sample" . I was under the impression that it was "kilo Bytes" and hence all the circus to find the size occupied by each sample ! )

Regards

Raghunathan
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 8 of 10
(5,265 Views)
Now that the samples riddle is solved I have a fundamental query :

- I am configuring two  AI channels  for 10kHz sampling rate and starting the Task . ( LV automatically sets the buffer at 100k samples )

- The Task then feeds into a 50ms timed loop and inside of the loop I have a AI DAQMx Read set for  acquiring  200 samples. / channel. Thus the Timed loop will fire 20 times every second  and in each of that instance read  400 samples making it to a total of 20 x 400 = 8000 samples / sec.

- Thus I will be filling the data buffer at the rate of 10000 samples every second and reading  them inside the  timed loop  at the rate of 8000 samples per second.

- For each second there will be unread data of 2000 samples and the buffer of 100k samples size will over flow in  50 seconds. This will defeat the FIFO data flow.

Even assuming that I manage to exactly match the rate of aqcuistion with the rate of read, what happen when the timed loop misses a beat ?

I am in fact running one such code and have been having random problems where none existed when I was just acquiring 1 sample / channel inside the timed loop with the software trigger.

Can someone throw some light on the proper configuration of such a  set up and how to ensure that buffer overflows / underflows are avoided ??

Thanks


Message Edited by Raghunathan on 03-20-2008 02:28 AM
Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 9 of 10
(5,135 Views)
Hey Raghunathan,

There are a couple things you could try to avoid buffer overflows.

1) Don't use a timed loop. Is there a specific reason you are using one? You loop does not need to wait in each iteration of the loop. This will speed up how often you make your reads.

2) Increase your Samples to Read value. This will take more data off the buffer each time. You could also set this to -1 to read all available samples off the buffer each time you call the read.
Regards,

Chris Delvizis
National Instruments
0 Kudos
Message 10 of 10
(5,113 Views)