03-31-2013 10:06 AM
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
04-01-2013 07:42 AM
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.
04-02-2013 04:51 PM
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.
04-02-2013 05:38 PM
@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.
04-02-2013 06:24 PM
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?
04-03-2013 05:22 AM
@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.
04-03-2013 02:45 PM
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.
04-04-2013 05:28 PM
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.
04-04-2013 08:26 PM
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
04-04-2013 09:26 PM
OK, I'll give that a shot tomorrow. Thanks...