12-21-2018 02:00 PM
Hello,
I have single device with four different channels. I am receiving raw for all the channel through TCP/IP. I decode raw data, and I got channel number and cluster (cluster contain three decimal values).
I have one class(Instrument) for single device, and four class(Channel) for each channel of device. One Channel class is dedicated to particular channel of device.
which element do I need to use as container? 3D array, waveform chart, or anything else...
I want the functionality on front panel like below.
I have listbox. Listbox contain 4 different channel. If user select channel 1, then waveform chart should display all the data of channel 1. If user select the channel 2, then waveform chart should display all the data of channel 2 (remove the data of channel 1).
12-21-2018 02:42 PM
A few options.
1. Tab control. 4 different waveform charts one on each tab. You can hide the tab control if you want if something else is supposed to change which is shown.
2. 4 different waveform charts all on same spot. Use property nodes to hide 3 and make visible the one you want to show.
3. 1 waveform chart with all 4 plots. Use property nodes to hide 3 plots and make visible the one plot you want to show. Of course legend shows all 4, so you may not want the legend to show.
12-21-2018 03:15 PM
What about
mcduff
12-21-2018 10:09 PM
@mcduff wrote:
What about
- 1 waveform chart, 1 plot. Use the List box to choose which class/object you plot. I do not know anything about OO, so not sure if this is possible, but something analogous to using the listbox as the index in index array, or as the selector for a case structure.
mcduff
But waveform charts have histories, and they'd get jumbled between the channels as you write the different channel data at different times. So you'd need to clear the history and rewrite the entire history.
I'd say forget about all I said before. Just use a waveform graph. Store the history for each channel in a shift register, and just write the data for the selected channel to the graph.
12-22-2018 02:03 AM
Thank you RavensFan for direction. I would like to store the data inside the Channel class, and load the data on waveform chart w.r.t selection of channel (selected channel in list box).
Is it any element available in LabVIEW, which is work like shift register, and keep as private member of class?
Do you think below step will work? It just my idea.
1) create array of cluster as private member of Channel Class.
2) on arrival of real time data, update the array using class method,
3) generate the notifier or User event for selected Channel only (selected channel; inside list box).
4) on received end of notifier or event update the Graph.
12-22-2018 02:06 AM - edited 12-22-2018 02:14 AM
Thank you RavensFan for direction. I would like to store the data inside the Channel class, and load the data on waveform chart w.r.t selection of channel (selected channel in list box).
Is it any element available in LabVIEW, which is work like shift register, and keep as private member of class?
Do you think below step will work? It just my idea.
1) create array of cluster as private member of Channel Class.
2) on arrival of real time data, update the array using class method,
3) generate the notifier or User event with new value for selected channel; inside list box.
4) on received end of notifier or event update the waveform chart.