Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

X-Series, Maximize data acquisition and processing with variable trigger rate

HI,

I have an X-series 6351 usb box which I'm externally triggering PFI LIne, reading a couple of Analog Inputs and outputing pulses on another PFI line. 

Inbetween is a PID loop which makes the decisions.  My external trigger rates are up to 200Hz but I'm trying to measure only within a 4us window.

In my code I"ve set up finite samples measuriing 10 samples per channel, only two channels. 

To measure within a 4us pulse window how can I optimize my clock rate and Samples?

 

I have it set up and working, but the code eventually becomes slow.

 

Any insight into this problem?

 

Thanks,

 

Jim

0 Kudos
Message 1 of 5
(3,459 Views)

 

If all the #'s you listed are requirements, I'm not sure you can really get there from here.

 

1. Max Sample Rate - 2 channel acquisition on your board will be limited to half (or likely a bit less) the 1.25 MHz max rate for 1 channel.  You're topping out somewhere around 600 kilosamples/sec which is about 1.7 microsec per sample.

2. A 4 microsec time window will only give you 2 or 3 samples, not the 10 you are planning on.

3. 5 msec PID loop rate may be pushing things a bit due to latency across the USB connection.  You may be ok, but I wouldn't count on it.

 

Can you describe your requirements in more detail?  Is there a 4 microsec pulse signal you can use to help define where the critical  time window falls within the 200 Hz control loop?

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 5
(3,443 Views)

So I really need to take my samples at up to a 200Hz rep rate.  I don't need to feedback at that rate.

My response can be slower but the trigger rate of the board can vary up to the 200Hz level.

 

Samples need toi be taken after the board is triggered externally on a pfi line. 

 

I need some some samples on an AI channel within the 4us window, i can time the acquisition with the trigger to get into the proper window.

 

Currently I"m getting data at an ok rate but things do start to slow down after a while. 

 

The PID loop then makes a decision and sends some counter pulses out on another PFI line.

 

 

 

 

0 Kudos
Message 3 of 5
(3,432 Views)

I'm gonna try to restate in my own words to be sure I'm clear.

 

Once every 5 or more msec (based on the 200 Hz or slower "rep rate"), there's a critical 4 microsec window of time for sampling AI channels.  These are used in a PID calculation, but the control loop can run at a slower rate than 200 Hz.

 

What exactly makes these samples more critical?  Are they the only samples that matter at all, or do you also care about the AI channels during the other 4996+ microsec?

 

What do you mean about data slowing down after a while?  Can you post your code?  I'm working on LV2013, so please do a "Save for Prev Version..." if needed.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 4 of 5
(3,425 Views)

Kevin,

you have it right, the critical sampling window comes in a 4us time window.  I'm currently triggering the module with an external box so I can get the data.

I"m down to 2 samples and 2 pretriggers at 150KHz sample rate.  After the data is acquired the PID loop runs and makes a decision whether to send pulses ou on another PFI channel to drive a stepper motor.  The code I inherited has issues already that I"m trying to address so I hate to post it so as to be distracted by style issues. 

 

I'm also now needing to add a pulse conter which will run in a different time window, measuring out 100us or so.  There will actually be 2 different operation modes and PID signals.  I may end up having to re configure the board programatically.  Not sure if this is possible. 

 

I'll try to get an example of the code attached soon.  Thanks for your help.

 

Jim

 

0 Kudos
Message 5 of 5
(3,376 Views)