ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

usb-6009 reference trigger using loops

Solved!
Go to solution

Hi,

 

I am a student studying for a Beng. As my final project I am looking to create a fault recorder for electrical motors. The basic premise is that it sits and waits for a trip signal, at which point it saves the analogue waveforms of voltage and current for a pre-defined length of time leading up to the trip.

 

I selected the USB-6009 as the DAQ, mainly based on price. At the time I didn't realise the importance of the pre-trigger (reference trigger) function which the 6009 does not support.

 

I am sure that there must be a way of using the computer memory to create a buffer using a continuous loop that keeps re-writing to a TDMS file, however I am really struggling to implement this code.

 

I know the ideal solution would be to use a better suited device, however having already purchased the device and stated it in my project specification this is not possible.

 

If anyone is able to offer any advice of a possible implementation of this solution and a potential example of a similar program, I would be forever grateful!

0 Kudos
Message 1 of 5
(4,901 Views)
Solution
Accepted by topic author Ianrosey

1. Do continuous acquisition. Keep the data in a circular buffer large enough to store the amount of pre-trigger data you want plus all the post-trigger data which may be acquired before the processing is complete.

2. When the trip signal occurs, either extract the pre-trigger data for stroage or store a marker which tracks where the pre-trigger data starts.

3. After the post-trigger data is acquired, write all the relevant data to the file.  Unless you have very long pre- or post-trigger data blocks, TDMS will not be required.  The USB-6009 is slow enough that you could keep a few minutes of data in memory before running into memory management problems.  That should be much more than you need for a motor fault recorder.

 

Consider using an Action Engine (search for Ben's Nugget on the topic) for the buffer. 

 

Lynn

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

Dear Lynn,

 

Many thanks for your quick response, I really appreciate it.

 

Would it be possible for you to offer me some advice as to how to set up the circular buffer for use with the data aquisition device, I have been trying to experiment with this since your reply and haven't been able to get any results.

 

Please understand that I am very much a novice to Labview, I undertook the project hoping that I would be able to get a good understanding of the program, however I am fast feeling that I have bitten off more than I can chew!

 

Thanks for your help.

 

Ian.

0 Kudos
Message 3 of 5
(4,827 Views)

A quick search for "LabVIEW circular buffer" found these:  Circular buffer using functional globals Queue based circular buffer Array as circular buffer and many others.

 

Lynn 

0 Kudos
Message 4 of 5
(4,816 Views)

Hi Lynn,

 

Thanks for all your help, having done some reading and playing around i've managed to get to the bottom of the problem, I was confusing myself by not realising that the output of the DAQ device is actually just an N dimensioned array.

 

Ian.

0 Kudos
Message 5 of 5
(4,779 Views)