02-08-2023 09:24 AM
Please let me know if this can be done and how to do this in a Labview vi.
I have n xy graphs. In a while loop during each iteration I can generate m (time,value) pairs, m <= n. Before starting the execution of the while loop, I would like to define the destination for each pair of data, for example, send (pair i) to graph j as plot k. A graph can have more than 1 plot.
Thank you.
Girish
02-08-2023 09:32 AM - edited 02-08-2023 09:35 AM
Yes, that's easily possible. what have you tried?
XY graphs take many datatypes (complex arrays, array of posts, cluster of x and y arrays, etc.), so it would be important to see how you are doing things. Please attach your code.
02-08-2023 09:46 AM
I have not tried anything yet. Only have some ideas. I will define n graphs, m (x,y) clusters and m toggles to turn on the desired number of total plots. In the while loop I will create a pair of time,value pair for each active plot. I do not know how to define the mapping, but I will have to pass an array of pair references in the order of plots to a graph. Does this make sense?
Girish
02-08-2023 10:03 AM - edited 02-08-2023 10:09 AM
First of all, the number of graphs is defined at edit time, but you can of course hide some if you don't need them.
Since you did not even attach a code draft (e.g. containing the desired front panel elements so we get a better idea!), let's first make sure we agree on the meaning of the terms:
Graph: An xy graph placed from the palette on the front panel. Each graph can have an unlimited number of plots.
Plot: A set of xy points on a graph, having color and cosmetics defined as in the palette)
Pair reference: I have no idea what that is! Please explain!
Variables: What are variables?
How many graphs? How many plots per graph? Is the time increment constant or variable? If the points are regularly spaced, you don't even need an xy graph! How should the "mapping" control look like?
02-08-2023 10:46 AM
The skeleton of the vi is attached.
I do want to plot points as they are generated, not xy graph at the end.
What I mean by mapping is given in the array in tab 1. Of course this is a test example. In the final application the user should be able to change the mapping as desired based on the type of data generated.
Even though in the test, the points will be at regular interval, I would like to use xy graph because in the final application they will typically be not at regular interval.
What I don't know is how to implement the mapping and sent the data to the specified plot.
Hope this clarifies your questions.
Girish
02-08-2023 11:24 AM
Thanks. I'll study it later in more details.
So you have four data sources and four plots. Shouldn't the matrix be size 4x4 instead of 3x4? What is the meaning of a row or column (graph? Plot?) What are you planning as string syntax? Wouldn't a 4x4 2D array of booleans be sufficient?
02-08-2023 11:51 AM
As I had said this is just a test case to conceptually show what I would like to do. The graph terminals are outside because I do not know how to send the pairs of data to the right graph based on the mapping. The matrix is inside by mistake as the test example is not fully functional yet. Yes, the time will be properly incremented.
In the final version, the data will come from instruments in real time and plotted on graphs. But conceptually, based on specific instruments in use, the data will be plotted on user specified graphs.
Thank you.
Girish
02-08-2023 01:45 PM
I still don't understand your switching matrix. Can some data be shown on more than one graph?
02-08-2023 01:50 PM
One data stream can be shown only on one graph. The 'switch matrix' defines the groupings of variables by graph. Of course, the user can change the grouping before execution begins, thereby changing what is displayed on each graph. So, for a given run, the groupings stay fixed.
Girish