LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pretty simple

smercurio is correct your vi so far has no architecture it would be best to use his program he wrote for you because it is tons more efficient than the code you are using.

Message Edited by Harold Timmis on 08-26-2009 04:53 PM
Harold Timmis
htimmis@fit.edu
Orlando,Fl
*Kudos always welcome:)
0 Kudos
Message 11 of 24
(1,015 Views)

So let me explain. The problem is not to create a graph and make some parts of it appear or disappear. It's only one part of it. The way it's done cannot be used, because the channel cannot be reloaded, it only makes appear 8 lines and and so on.

The shift register is for this, to reload each channel.The 8 lines i used is only an example, of course the original problem is not a line, it is a signal that is collected from a hardware device.

0 Kudos
Message 12 of 24
(1,006 Views)
smercurio_fc, if I set the way you said, does not work. The 8th line desappear in the beginning. And the lines start to change colors.
0 Kudos
Message 13 of 24
(997 Views)

What do you mean by "reloaded"? Are you saying that you want the on/off controls to control the visibility and the collection of data? If that's the case, then, yes, you should use a shift register. But there's still a better way to do it:

 

 

EDIT: Actually, now that I think about, instead of that hard-coded 8 you could also just use a property node to get the value of the cluster and do another Cluster to Array to get the size of it. 

Message Edited by smercurio_fc on 08-26-2009 05:17 PM
0 Kudos
Message 14 of 24
(995 Views)
Man, what you did is nice, pretty nice. But it's completely different from what I want. I just want that when the false condition of the case structure is set then it does an action. The action is to clear one line that corresponds to each channel. Only this. But I don't know how to do it
0 Kudos
Message 15 of 24
(988 Views)

danilorj wrote:
The action is to clear one line that corresponds to each channel.

I'm sorry, but now you're just not making sense. Which line from "each channel"? Why would unchecking, say, channel 4 be clearing anything from the other channels?

 

You have not made it clear whether you're generating data all the time and just need to turn on/off certain channels, thereby not collecting the data from that channel, OR whether you're collecting the data, displaying it, and then simply allowing the user to hide/show certain channels on static data. . Your description implied that you're continuously collecting data, and that when unchecking, say, channel 4 you wanted that channel to go away. Well the second VI I wrote does that. The data is generated each time you run around the loop. It's not static. Replace the sine waveform generator with a noise generator and you will see. If you're not generating data continously, then a variant of the original VI I showed you is more appropriate.

0 Kudos
Message 16 of 24
(975 Views)

OK, let me try to summarize what I understand so far. I am still not sure what you really want.

 

You have 8 potential channels, and you mant to be able to interactively hide/show some of the traces.

 

Your graph accepts a 2D array where each row corresponds to the data of one channel. All rows in a 2D array are necessarily of the same lenght, so all channels must contain the same amount of data.

 

From what I can tell from your code, it seems you want to built a new 2D array that only contains the selected channels. This is not a good idea, because the channels no longer always correspond to the original row indices. For example if you hide channel 5, the last row will be the 7th channel and will no longer correspond to the correct graph legend. Thus, if you go this way, you would also need to dynamically rewrite and resize the graph legend, which is a unecessary mess and distracting to the user.

 

The correct way is to use Saverio's technique of simply hiding the deselected data (=color it transparent) if you don't have data for the missing channels, create some dummy data (e.g. all zero). One disadvantage is the fact that the color in the legend also disappears for the hidden channels.

 

An alternative would be to show/hide by manipulating the data. This will only work if your data is orange (floating point, e.g. DBL or SGL). You could start out with a 8xN 2D array initialized with NaN and then replace corresponding rows with real data (size=N) for the channels you want to show.

 

 

 

0 Kudos
Message 17 of 24
(972 Views)
altenbach, could you please send me the vi with the modification you said?
0 Kudos
Message 18 of 24
(959 Views)

danilorj wrote:
altenbach, could you please send me the vi with the modification you said?

 

The VIs are currently only virtual, and exist only in my mind. 🙂

 

Since I suggested several alternative modifications, let me know which one you want. It would only take a few strokes of the mouse to modify a real VI. 🙂

0 Kudos
Message 19 of 24
(955 Views)
The last one.
0 Kudos
Message 20 of 24
(933 Views)