Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ newbie -- displaying array output

I've just taken over a DAQ setup in our lab and I'm trying to produce a VI to display strain gage data. I'm using the standard NI example VI, and it works just fine as far as displaying a chart is concerned, but I'm also trying to display the strain values numerically. I did a "Create>>Indicator" on the wire coming out of DAQmxRead.vi, as shown in the attachment.

 

As I said, the chart data responds nicely to strains on the test rig, but the indicator displays only grayed-out zeroes. Suggestions? TIA...

 

deadstick

0 Kudos
Message 1 of 13
(3,779 Views)

Your problem is that you are pulling out an array of waveforms.  What you need to do is use a FOR loop to go through each waveform and extract the Y (use Unbundle By Name).  Create a 2D array on the front panel and wire out of the FOR loop and to the indicator.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 13
(3,764 Views)

OK, I'm getting a bit closer here. I'm running four strain gage channels in continuous mode, at 1 sample per channel per second, so I've indexed the FOR loop to 4. I wasn't able to get to the Y waveform component with "Unbundle By Name", instead using "Get Waveform Components". I take it that the FOR loop is supposed to handle the indexing here.

 

The 2D array on the front panel displays only one value window and two array index selectors.

 

As before, the chart display works normally; the single value window in the array cluster shows a grayed-out zero most of the time, but occasionally blinks once with a value.

0 Kudos
Message 3 of 13
(3,740 Views)

@deadstick wrote:

OK, I'm getting a bit closer here. I'm running four strain gage channels in continuous mode, at 1 sample per channel per second, so I've indexed the FOR loop to 4. I wasn't able to get to the Y waveform component with "Unbundle By Name", instead using "Get Waveform Components". I take it that the FOR loop is supposed to handle the indexing here.

 

The 2D array on the front panel displays only one value window and two array index selectors.

 

As before, the chart display works normally; the single value window in the array cluster shows a grayed-out zero most of the time, but occasionally blinks once with a value.


You don't need to wire the 4 constant to the FOR loop.  Let the autoindexing do the job.

 

You can expand the 2D array indicator to show as many elements as you want.  Drag from the corner of the indicator.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 13
(3,734 Views)

OK, yeah, I suspected that about the constant, so I removed it. I also expanded the array to encompass four values. Am I correct in thinking that the two selector windows alongside the value windows are row/column selectors?

 

At any rate, the value windows remain grayed-out zeroes. I take that to mean that I'm endlessly growing the array, and the indicator is trying to display the wrong members.  What I'm trying to get is a display of the most recent set of values for the four channels, updating with each new sample, which is currently once per second. Should I be using some other output setup?

0 Kudos
Message 5 of 13
(3,730 Views)

@deadstick wrote:

At any rate, the value windows remain grayed-out zeroes. I take that to mean that I'm endlessly growing the array, and the indicator is trying to display the wrong members.  What I'm trying to get is a display of the most recent set of values for the four channels, updating with each new sample, which is currently once per second. Should I be using some other output setup?


Grayed out zeros mean you are at the end of your data.  How many samples are you reading at a time.  The array will only show your latest samples.  I'm assuming you are using a chart for your other display, which keeps a history.  If you want your array to show all of the accumulated values, you will need to keep the array in a shift register and append to it after each read.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 13
(3,715 Views)

I'm not trying to show all the data -- just the most recent value for each channel. In other words, with four channels running continuously at one sample per second, I should see four numbers that update once per second.

0 Kudos
Message 7 of 13
(3,696 Views)

OK, I'm blanking on something here. Showing the latest samples is exactly what I want to do, but it isn't happening. The samples are coming over continuously at once per second, the chart is displaying just fine, but I still get nothing in the numeric  indicator. All I want to see there is the last measured value of each channel.

0 Kudos
Message 8 of 13
(3,661 Views)

Is your numeric indicator the "array"?. I built the same VI and I can see the last value displayed. You could check the INDEX you have selected for the array in the front panel. Or maybe you could try to expand that array in the front panel to check the information in the different rows and columns, then you can edit it to display just the last value.

 

Regards

0 Kudos
Message 9 of 13
(3,650 Views)

OK, I'll give that a shot tomorrow. Thanks...

0 Kudos
Message 10 of 13
(3,645 Views)