LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

graph the data from frames to the same indicator

Hi all,

I have a stacked sequence and in each frame I acquire data. The data will be dispayed in a graph indicator; but I want to avoid to have N=the number of frames indicators, but only have one, where one frame flows in the data exclusively(a frame displayes the data in the indicator, then, when it passes to the next frame the previous data is not displayed, but the current one is, so on).

Can one tell me how to do it? THank you.
Dana
0 Kudos
Message 1 of 15
(3,719 Views)

Hi Dana,

you can use a property node of the graph or a local variable to do that. See the attached example.

Hope it helps.

Mike

0 Kudos
Message 2 of 15
(3,709 Views)
Thank you, Mike.
The solution is very nice, I wasn't thinking about property node, but something much complicated.
Nonetheless, I encounter some errors I don;t know how to handle.
What I do is to create the property node in the 1st frame(frame 0) and then copy it in the 2nd frame(frame 2, in my case). The one that yields asks for reference (maybe because in total I have 2 graph indicators in the application and i need reference to make things unambiguous.) So I pass the reference with a sequence local from the frame, and I get an error about not having wired it well and one about the difference of the array dimensions of the data I graph. I don't understand why the dimension should count, the graph indicator should display any data I pass to it.. Where am I wrong?

I attached the VI, maybe you can have a look - the display should take place in frame 0 and 2.

0 Kudos
Message 3 of 15
(3,703 Views)
Hi dana,

you can also collect the data from each frame in an array (using "build array" in concat mode in each frame).

Btw.:
You should also replace your stacked (arrgghh...) sequence with a flat one (no need for sequence locals anymore).
An even better approach would be to replace it by a case structure and a while loop around it (aka state machine) - now you may even break the "sequence" or have any order of "frame"  execution.
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 15
(3,701 Views)
Hi dana,

when copying block diagram elements you can use ctrl-key and mouse-click&move to create new property nodes using the same reference. This way LV behaves different to using ctrl-c/ctrl-v!

When building arrays you can set the build mode by right-mouseclick -> concatenation mode: either add a new dimension or append/concatenate to existing array...


Message Edited by GerdW on 03-04-2008 03:20 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 15
(3,700 Views)
Hello, Mike.
I solved the problems:
- 1st one was my dummy lack of attention, sorry about it
- 2nd - I don't like the solution I found. I understand that the feature of the graph indicator is for 2d data, but isn't there a way to shrink it to 1D when the case asks for it, rather that to boost my data to fit the 2d dimensionality?

Hello to you GerdW,
thank you for the tips. I didn't know about key+mouse configuration, i needed it. Regarding the others, I will take  them into account next time.


Best,
Dana
0 Kudos
Message 6 of 15
(3,697 Views)
Dear fellows,

please allow me to ask a basic question:
how should I visualize in my mind a 2D waveform, like tha one that results from the acquisition. At the moment, I imagine a matrix made of 2 columns, among which one contents the values acquired from N channels (so I have N rows). (see the Jpeg attached). So when I use the Index Array.VI with the index K, then should I imagine that I extract the Kth raw out of the 2D arrray?
Whereas, for the 1D data, should  I think about the vector as the first raw in the picture I drew?
If I'm right so far, what's the content of the second column?
If no, then what's the content?

Thanks so much,
Dana
0 Kudos
Message 7 of 15
(3,694 Views)
Hi Dana,

it's an array, not a matrix Smiley Very Happy

In your DAQ you read multiple channels with multiple samples - this makes a 2D array of values. Each column contains values of 1 channel, each row contains the n-th value for each channel (maybe column and row is switched to this explanation, can't test it here).

You can visualize this by using a 2D numeric array indicator (just right-click the output wire of the DAQ-read and create->indicator).

Btw.:
Replace the property node in frame 2 by a local of the graph, no need for wiring references and sequence locals. See attachment (still to be cleaned up after conversion to flat sequence).


Message Edited by GerdW on 03-04-2008 04:30 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 15
(3,681 Views)
Hi Dana,

some more comments for cleaning up your vi:
- Instead of a simple while loop with a stop button and a string output (which belongs outside the loop!, frame 1 & 3) you should use the "one button dialog" function from labview. You don't need a string output, stop button (in each loop/frame).
- Wire the error cluster and resource reference through every frame of the sequence to get a "linear" dataflow. This will help to get rid of the sequence at all.

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 15
(3,668 Views)

You are really approaching this entire problem way too complicated. I suggest you use a simple state machine with a single outer loop and basically two states, one for the work and one for the wait.

You polling wait state definitely needs a small wait statement.

Your work states are nearly identical, differing only in the waveform type and some data handling. All shared code needs to exist only once and only the differences need to be in small case structures. Now you can use a single terminal for all data of all work states and no longer need to mess with value properties and such. Your code is too complex by at least a factor of three for no reason.

 

0 Kudos
Message 10 of 15
(3,665 Views)