Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing a PCI-5114 with a USB-6229

Solved!
Go to solution

Hi,

I'm trying to make several measurements with a couple of NI digitizers: the first is a PCI-5114 that will read a signal, utilizing the maximum sample rate of the 5114.  This is currently functioning, and is triggered by a digital pulse at 1 Hz.

 

Secondly, I have 5 other channels, and I want to measure the maximum voltage on each (analog inputs), at the time the PCI-5114 is recording data.  My thought was that I could have the USB-6229 read data continuously, then once the 5114 triggers, I will read out the past ~1000 records from the 6229.  I'm not sure that this will work, because I can't be certain that the data the 6229 collects will be from the same time as the data that the 5114 collects.  Is there a clever way to ensure that this is the case? (external clocks, exported triggers from the 5114... I just don't know what the options are)

 

For full disclosure, I have 8 digital outputs through the same USB-6229.

 

Alternatively, if there's a good way to measure the max of each of my 5 channels without downloading 1000s of data points, that would also work.

 

Any help or advice is much appreciated!  Thanks!

Karl

 

0 Kudos
Message 1 of 5
(2,984 Views)
Solution
Accepted by topic author Karl T.

Hi Karl,

 

The 6229 supports reference triggering (link to manual), so you could trigger it off of the same 1 Hz signal that you are using to trigger your Scope.  You can specify the sample rate, total number of samples, and number of pre-trigger samples--doing this should allow you to correlate your acquisition on the DAQ card to the same time window that your scope is acquiring data.  The clocks would still be independent, but I don't think this should matter too much since you are triggering from the same external signal every second.

 

After the DAQ card is triggered you will need to re-start the task in software to re-arm it (something like this example), but the 1 Hz interval should be more than enough to do this.

 

 

Best Regards,

John Passiak
0 Kudos
Message 2 of 5
(2,959 Views)

Thanks, this seems to work!

0 Kudos
Message 3 of 5
(2,927 Views)

I have to re-open this discussion: on some of the data collection cycles (again, one data collection per second; our system triggers at 1 Hz) the USB-6229 does not collect data, it seems like it doesn't tigger.  This gets the two systems out of sync: the LabVIEW code waits for the 6229 to collect data, but it doesn't catch the first trigger, then it goes for the next, 2 seconds later.  Then my data writes out of sync.

 

Is there a way that I can just skip that record?  Or maybe recognize the issue in some way?

 

Or, maybe this is a problem with the USB traffic.  There are a couple different devices on the USB chain.  Can I make it so info from the 6229 is the number 1 priority?  This could avoid missing triggers, I'm not sure.

 

Any help or suggestions are always welcome.

 

Karl

0 Kudos
Message 4 of 5
(2,864 Views)

Hi Karl,

 

It sounds like the task is not re-arming quickly enough to keep up with the trigger after-all. 

 

Are you acquiring any pre-trigger samples relative to the external trigger signal?  I had assumed you were for some reason, but I notice in your original post you didn't mention anything about this.  If you don't need pre-trigger samples, a better method would be to use the counters to generate a sample clock for the AI task (see this example).  The counters are re-triggerable so the benefit to this method is that you no longer have to rely on software to restart the task.

 

 

If you do need pre-trigger samples or if you don't have the counters available, your current hardware would require you to restart the task in software.  I'm curious how many pre- and post- trigger samples you are acquiring per trigger and at what sample rate you are acquiring.  If you have to rely on software to restart the task, and if not enough time is given to ensure that the task is able to restart, then it's quite possible that you would miss trigger edges while the task is re-arming.  Depending on what exactly is required, we can probably work around this in software.  For example, you could sample the AI continuously synchronized with the Digital Input and use software to determine which data to keep that correlates to your desired time window around the digital edge.

 

 

Best Regards,

John Passiak
0 Kudos
Message 5 of 5
(2,839 Views)