Showing results for 
Search instead for 
Did you mean: 

Adding control to select chart input data?

Go to solution

I have a device that sends out multiple channels of data via TCP.  I created a VI (attached) which parses this data into multiple integers.  I can connect a chart (I am using strip chart mode) to any of these inputs.  The problem is there are about 50 channels and I do not want 50 strip charts.  I would like 4-8 charts, with the ability to select the input channel for each using a control.  Any ideas on how to accomplish this?  Thanks!


0 Kudos
Message 1 of 5
Accepted by topic author amp0

Use Index Array.  Connect the boolean array to Index Array. Connect the channel selector to the Index input. Wire the output to the chart through the Boolean to (0,1) primitive.


For multiple charts expand the Index array and connect the selector for each chart to a different Index input.


chart selector.png



0 Kudos
Message 2 of 5



Thanks a lot - you got me going in the right direction.  Now I have the first major part completed - I have multiple charts, each of which can select any channel for display.


Maybe you can help get me started with the next major part.  While this VI is running it should store all channels to a file.  This file should be able to be imported later and any channel viewed - with x axis scrolling, x and y markers (absolute and delta), and zooming or x scale control.  Playback could happen with a different application if that makes more sense.  Any input is appreciated.


I am attaching my latest VI.





0 Kudos
Message 3 of 5



Glad you got something working.


Your VI can probably be simplified quite a bit.  Without knowing the string format and without having some data to work with, I am not going to try to reverse engineer your code.  For example you do not need to convert the arrays to variants to connect them to the variant input of the Variant to Data function.  A variant input will accept ANY datatype. Look at the detailed help.  The conversion primitives probably are all you need where you are converting shorter integers to I32.


Storing the data in a file is straightforward. The Write to Spreadsheet will accept a numerical array as input.


All the things you want to do for playback are also do-able. Scrolling, zooming, and scale changes can be done with array manipulations or graph property nodes.  Whether it will be easy or fairly complicated depends on how elaborate you want the controls to be.  Plan on spending some time learning the idiosyncracies of the graph properties. It is not difficult but there are many combinations possible and some do not work well together.  For example zooming by changing axis range with autoscaling turned on works but creates an annoying flicker effect. I know - I just did this this week.



0 Kudos
Message 4 of 5



Thanks for the suggestions on simplification.  You are correct, I only needed the I32 conversion primitive to convert my arrays from other types.


"Write to Spreadsheet File" seems to be working fine.  I haven't dug into playback much yet, but I'm sure your suggestions will help.




0 Kudos
Message 5 of 5