LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I get seven analog pulses per cycle, how do I index these pulses into an array of 7 seperate values?

Solved!
Go to solution

I am a LabView beginner.  The goal of my project is to measure intensity values using a phototransistor module fitted between a motor blade that has seven slits.  So each cycle/motor rotation, I get seven pulses between 0 and 5 volts.  Right now, there is nothing to impede the IR light, so I get basically digital pulses.  I am setting this up for the eventual task of measuring energy that gets absorbed into CO2.  The intensity of the light will be inversely related to the carbon content of a sample. 

Right now, all I'm getting is a constant amplitude of 5V, but I can see the pulses on the graph.  My LabVIEW question is this: How can I translate the pulses seen on the graph into an array of 7 different values?

 

The wider pulse seen in the graph is due to the material taped over one of the 7 slits.

 

 

Capture Chopper.PNGimage1.jpeg

 

 

0 Kudos
Message 1 of 8
(3,425 Views)

Hi fowlerd, there are a couple ways to go about this.

1. You can set a trigger level on your analog input, and trigger off of the same channel you are collecting. You will need to pick your threshold value before collecting your data.

2. You can go through your array of data as it is and look for transitions. Once you find the indices of the transitions, you can split the array up using "array subset".

0 Kudos
Message 2 of 8
(3,361 Views)

Thanks Gregory,

The first option makes more sense to me, but I get the error: "Error -200265 occurred at DAQmx Start Task.vi 7220003.

An attempt has been made to use an invalid analog trigger source. 

Property: Start.AnlgWin.src

Corresponding Value: empty string

 

Valid Choices: none

 

Device:cDAQ1

 

What's going on here?  I followed to NI example on their help guide.  I'm using a NI 9215 to collect and measure the analog pulses.

0 Kudos
Message 3 of 8
(3,340 Views)

I'm not familiar with that module, but it looks like it might not support triggering.

0 Kudos
Message 4 of 8
(3,326 Views)

Do you have precise control over the speed of the rotation?  If you know it always runs at a certain RPM or whatever, you can just divide up your graph into sections of time equal to the motor rotation, and then integrate all samples taken in one section to give you the value.

 

Can you take an acquisition with a second sensor at the same time, and get another readout that will always be a square wave?  Either farther out on the rotation of the device outside of where your sample is, or just a RPM readout from the motor itself?  Syncing your 1st sensor to another signal would give a lot more definite results.

0 Kudos
Message 5 of 8
(3,315 Views)

I've been making a habit lately of quizzing people upfront to make sure we aren't solving the wrong problem.

 

1. The data you presented is pretty clean-looking pulses.  You've described your real goal to be a problem about CO2 absorption that can be expected to change the appearance of the data you take, probably pretty significantly.

     What's a reasonable expectation about what your END data might look like?

 

2. You say you want to boil down this rev of 7 pulses into 7 distinct numbers.   Do you care about peak amplitudes, timing between rising edges of consecutive pulses, widths of individual pulses, integral under the curve of each pulse?

     What should those numbers represent?

 

It isn't clear to me that working out an algorithm for your clean "perfect" pulse data will end up being useful in the long run.  It very much depends on the kind of info you're looking to tease out of the pulses, and how well that process will translate to the non-idealized data you'll later get from your real tests.  (And I also recognize that you might not yet know or be able to predict what the real data will look like.  Them's just the breaks sometimes.   It's a good instinct to want to start working on algorithms ahead of time, but it doesn't always turn out to be time well spent.)

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 8
(3,296 Views)

Thanks Kyle,

Each rotation is 12.5 Hz.  How would I go about splitting this up, as well as syncing the pulses with the time being sampled?  I would get 7 pulses every 0.08333 seconds or 1 every 0.01143 seconds. 

0 Kudos
Message 7 of 8
(3,257 Views)
Solution
Accepted by topic author fowlerd8

There's a VI called "Get waveform subset" in the Waveform palette.  Use that to split the waveform into segments corresponding to one rotation.  After splitting, then you can analyze each pulse separately.

 

As for syncing, you'll probably need some form of separate input.  Either leave one of your gaps blank each time as a "timer", or use an extra input line that you capture in sync with your data the syncs up.  Either another sensor like the one you have now but one that is mounted on an unfiltered area for a clean signal, or a sensor that picks up rotational information from your motor somehow, if it either has an electrical output you can read each revolution or if you can create one manually somehow.

0 Kudos
Message 8 of 8
(3,240 Views)