LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ setup

Wow that one is perfect. Thank you.

 

I see that you added different waveform graphs. Where did you find these at and did you modify them for default?

 

What does coupling the mean and the index array do?

0 Kudos
Message 21 of 27
(455 Views)

The graph indicator automatically changes to handle the data type wired to it. Instead of wiring the dynamic data type, I wired 1d Arrays to them. What do you mean "did you modify them for default"?

 

The story on the from dynamic data -> Waveform -> Mean -> Index Array

The dynamic data returns all of the data in one bundle I want an array of waveforms with each waveform being a single channel (double click the "From dynamic data" node to see how I've configured it)

 

Now I have a waveform containing all 100 points of data in the waveform element, I could have used the "Get waveform component" primitive to extract just the "Y" values (or data array) but I'm lazy and let LabVIEW do that for me and simply loop through each waveform in the array and calculate the mean of each waveform (remember each waveform represents a different channel). The for loop is set to auto-index the output so now the output is a 1d array of 6 elements representing your 6 channels average data.

 

Index array simply allows me to grab each of the 6 channels averaged data and plot it.

 

 

Did this help your noise problem?

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 22 of 27
(454 Views)

I suggest you avoid the use of the Dynamic Data Type (and Express VIs too).  Even though you a just coming back to LabVIEW you've already seen that they can create much more confusion than they're worth.  It may seem easier at first because there are no broken wires and everything just seems to work.  Unfortunately, as you found out, you weren't gettting the results you expected.  Converting a waveform DDT (from the Express VI) to a scalar DOES work.  BUT, it works by simply tossing all the data except for the last datapoint in the array (in most cases it's pretty much a random value).  This probably explains all the noise.  The Mean.vi that Charles used is the way to go here.

 

OK, end rant on the DDT.

 

The main reason I posted was to ask whether you meant to reverse the data in the last three arrays.  You've wired the build array VIs with the scalar input on top rather than on the bottom.  This is very different and will have the same effect as reverse 1D array VI.  If that's what you wanted, cool.  But if you just wired them that way for a  cleaner looking block diagram and you don't want backwards data you'll need to change it.

 

BTW, there's a useful feature in LabVIEW:  You can right-click the Express VI and convert it to DAQmx code.  This way you can set everything up using the Express "wizard" and then convert your code to see how it works under the hood. It's a great way to learn DAQmx.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 23 of 27
(447 Views)

@NIquist wrote:

I suggest you avoid the use of the Dynamic Data Type (and Express VIs too).  Even though you a just coming back to LabVIEW you've already seen that they can create much more confusion than they're worth.  It may seem easier at first because there are no broken wires and everything just seems to work.  Unfortunately, as you found out, you weren't gettting the results you expected.  Converting a waveform DDT (from the Express VI) to a scalar DOES work.  BUT, it works by simply tossing all the data except for the last datapoint in the array (in most cases it's pretty much a random value).  This probably explains all the noise.  The Mean.vi that Charles used is the way to go here.

 

OK, end rant on the DDT.

 

The main reason I posted was to ask whether you meant to reverse the data in the last three arrays.  You've wired the build array VIs with the scalar input on top rather than on the bottom.  This is very different and will have the same effect as reverse 1D array VI.  If that's what you wanted, cool.  But if you just wired them that way for a  cleaner looking block diagram and you don't want backwards data you'll need to change it.

 

BTW, there's a useful feature in LabVIEW:  You can right-click the Express VI and convert it to DAQmx code.  This way you can set everything up using the Express "wizard" and then convert your code to see how it works under the hood. It's a great way to learn DAQmx.


I agree. DDT is a pain to use, express VI's usually include too much garbage. However, if you need something cheap and dirty so to speak then they will get you by. If you are trying to learn how to write good LabVIEW code, definitely try to avoid them. The only express VI that I use on a regular basis is the "Time Delay" and that is simply because of NI's GROSS negligence of not inlcuding error terminals on the wait ms primitive.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 24 of 27
(445 Views)

Cheap and dirty certainly does have it's place.  Unfortunately LabVIEW in general kind of encourages it due to it's connect the blocks paradigm.  The main problem is that students jump on this Express stuff without understand the caveats involved and end up more confused as a result.  I blame the parents. Smiley Tongue

 

Agreed on the Wait VI AND the Elapsed time one is pretty useful too.  I always had my own wait VI but now I use the OpenG tools (get them with VIPM) which include the errors terminals in its wait.vi version.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 25 of 27
(443 Views)

NIquist,

 

You are absolutely correct. I didn't mean to switch the last three arrays and I was wondering why I was getting the last three graphs backwards =).

 

And the only way I learned to get data from a DAQ was through DDT so I haven't known any other way.

 

Lastly and unfortunately, I stumbled onto another problem (novice here so be gentle in your yelling =)). It seems that all 6 of the outputs I am trying to get are proportional, just have slightly different magnitudes. I went back and looked at my DAQ and I noticed something that might be the issue. On the USB-6210, I shows I can either have 16 ports or 8 (with separate +/-). Could I be doing something wrong within my DAQ to cause this?

 

Coulton

0 Kudos
Message 26 of 27
(438 Views)

@Coulton wrote:

 

Lastly and unfortunately, I stumbled onto another problem (novice here so be gentle in your yelling =)). It seems that all 6 of the outputs I am trying to get are proportional, just have slightly different magnitudes. I went back and looked at my DAQ and I noticed something that might be the issue. On the USB-6210, I shows I can either have 16 ports or 8 (with separate +/-). Could I be doing something wrong within my DAQ to cause this?

 

Coulton



We have already determined that you have that part setup correctly, that was the "Input Terminal Configuration" that we spoke of early which you properly have set to differential.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 27 of 27
(428 Views)