LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency acquisition yielding inconsistent results

I'll attach my VI.  The DAQ assistants in question are in the lower left.

I'm using the counters to get period (one is single pulse per revolution, one is two pulses per revolution).  Taking either 30 (for the two-pulse per revolution) or 60 (for the single) and dividing by the period output to get a RPM number.

(Ignore the DAQ assistant in the case structure)

Notice each daq assistant is set to take 10 samples at 500ms.  I'm assuming it's putting out an average of these samples, no?

___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 11 of 22
(1,208 Views)
When I opened the front panels of the DAQ Assistants 15 and 16, I find that the default is to collect 10 samples. It returns those samples from the DAQ Read as a 1D array of double which is converted to Dynamic data connected to the Data terminal. You do not get an average, you get the 10 readings. You could use the Mathematics funcitons to calculate the mean. The Cage One and Shaft displays only show one element of course. I do not know which one.

Please look at the style guide. Diagram larger than two screens, wires running behind objects, wires running right to left, ... all make reading the diagram quite difficult. I suspect that there is a lot of unnecessary duplication of code. Note that for the guage-type indicators you can select VIsible Items >> Digital display and you do not need a separate numeric indicator.

Lynn
0 Kudos
Message 12 of 22
(1,192 Views)
Yeah I got reamed about the style a lot in a previous version of this program.  It's a million times better than it was, and almost all of my wires go the right way now!
 
I also can't think of any way to fit all this info in one screen.  I'm not at that level yet!
 
And whilst stumbling around earlier today, I remembered about the digital displays.  I'll work them out of the VI on my next major edit.
 
Please bear with me, I'm completely self-taught at this and have only been in the game since 8.0!
 
What I ended up doing, which seemed to work well, was using the 'Time Averaging' express Vi which seems to act like that window averager that has been referred to in here already.  My readings are MUCH more stable now.  Before I was getting a net difference of 70RPM on one and 50ish on the other, now I'm getting one or two and I can live with that.
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 13 of 22
(1,190 Views)
Lots of us are self taught. We just started earlier. I am working with a direct descendent of the program we wrote in version 1.2. It was re-written in LV 5 and has been upgraded to 8.2. It is in bad need of another re-write, but too many higher priority things are on the list.

Creating subVIs is the best way to reduce the size of the diagram. With the number of controls and indicators you have, you would probably need to use clusters because of the limitation on the number of connections you can make to a subVI.

Cleaning up the wiring will help you find errors like the Oil One and Two Undete Temp indicators being driven from the Oil Two and One Low Limits, respectively.

Lynn
0 Kudos
Message 14 of 22
(1,181 Views)
Yeah, that's funny, I caught that error earlier today too.

If that's the biggest mistake I have, I'll be thrilled!

How would i go about creating a subvi from bits of code anyway?  I know the concept, but don't know how to make it into an icon with wire terminals and all that.  Can you point in a direction?  Thanks.
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 15 of 22
(1,173 Views)
Check out this paper,G Programming Reference Manual, chapter 3 gives step by step instructions for creating a subVI in LabVIEW.
Alex A.
Applications Engineer
0 Kudos
Message 16 of 22
(1,167 Views)
OK, I took a chunk of my code (that RPM down in the corner) and made a subvi with DAQmx tasks.  Can anyone look at this and tell me if it's correct, or give pointers on what to change?
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 17 of 22
(1,158 Views)
After creating a subVI you often need to make a few adjustments. For example the error in and error out clusters are conventionally on the bottom corners of the connector pane, inputs on the left, and outputs on the right. Also cleaning up the wiring helps. You will usually want to edit the icon and it is a good practice to put a description in the Documentation section of VI Properties so the context help will explain what the VI does.

The Time Averaging VI does not produce the average of the points in a single run. Maybe this is what you want. The mean fucntion will return a single number equal to the average of the datapoints fed into it. I modified your VI to show some of these points. I put in Diagram Disable structures since I do not have any hardware.

Lynn
0 Kudos
Message 18 of 22
(1,144 Views)
So I should just toss the time averaging feature and basically run it like this?  (see attachment)  I'm assuming the enabled states on yours were to bypass the missing elements on your system, correct?  And the time averaging and my dd output are no longer needed?
___________________________________________________________________
Still confused after 8 years.
0 Kudos
Message 19 of 22
(1,139 Views)
Yes.

Unless I misinterpretted your intent.

Actually you do not need the Stop Task.vi fi you are done with the task. Clear Task.vi will stop a task before it disposes of it.

Lynn
0 Kudos
Message 20 of 22
(1,133 Views)