Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

arteitle

Active Participant

02-23-2018 08:05 AM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report to a Moderator

You can feed an XY Graph two different ways.

Option one:

- Bundle each X,Y pair into a cluster (one point)
- Build an array of points (one plot)
- Bundle each plot into a cluster by itself
- Build an array of these clusterized plots

Option two:

- For each plot make two identically-sized arrays, one of X values and one of the corresponding Y values
- Bundle those two arrays into a cluster (one plot)
- Bundle each plot into a cluster by itself
- Build an array of these clusterized plots

If you need more help with this, share your code so we can see where you're having trouble.

Ben

Knight of NI

02-23-2018 08:14 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report to a Moderator

If the "X" values are time then you can use a Waveform data type such that the "T0" values are the time.

There is also a variation on this that comes with the sound a vibration stuff that uses the frequency as if it is T0.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel

arteitle

Active Participant

02-23-2018 08:55 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report to a Moderator

altenbach

Knight of NI

02-23-2018 10:13 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report to a Moderator

@M.Mei wrote:

The x value is from the instrument and the number of plots is not fixed. I got an array(the dimension is typed by users ) as output from an instrument, now I want to display these lines (the first dimension is the x value, and y values respond the remaining dimension). I am very sorry I still do not know how to begin this vi, so I cannot upload a sample...

OK, so you have a 1D array of x values of size N and a 2D array of Y data with N columns and M rows (or vice versa. M=number of plots, which is variable).

So all you need is the following (If the Y values are arranged as rows instead of columns, omit the transpose, so modify as needed):

02-23-2018 11:56 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report to a Moderator

02-23-2018 12:00 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report to a Moderator

02-23-2018 12:02 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report to a Moderator

Thanks Ben! The x value is wavelength not time.

altenbach

Knight of NI

02-23-2018 12:02 PM - edited 02-23-2018 12:46 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report to a Moderator

@M.Mei wrote:

Please attach your VI (or a simplified version) with some typical data. You seem to have a 3D array (why???), so what are the meanings of the various dimensions and where is the x array located?

In any case, your "build array" and shift register is unnecessary. You could as well autoindex at the output tunnel to get the exact same 2D array. Try it. Simplify!

Also, since you index out the first dimension wired to [i], you could autoindex at the input tunnel of the 3D array, eliminating getting the size and wiring N.

02-23-2018 12:59 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report to a Moderator

altenbach

Knight of NI

02-23-2018 01:37 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report to a Moderator

OK, as a first step you need to familiarize yourself with arrays in LabVIEW. If you did not even know that you had a 3D array, that's not very promising. Is it possible you are accidentally inserting a "built array" or extra "autoidexing" somewhere upstream? Can you show us the upstream code?

For example here are two alternative codes that do __exactly the same__ as your picture earlier, but with much less code (see also my signature!)

Just FYI, this is probably __not the solution__ to your problem.

One of your dimension is size 1, so maybe you are really only dealing with a 2D array. If not, please attach a VI that has default data in all three dimensions.

@M.Mei wrote:

'Number' corresponds to the number typed in by users, e.g. in the vi, if you type in '5', then the number 5 line will display in the graph, rather than 5 lines.

Well, earlier you wanted to display multiple plots, so to select multiple plot, maybe you want an array of numbers, one for each plot. Or you could use a boolean array with one switch for each plot and the user can select which one to graph by turning them on/off. Learn about conditional tunnels for an efficient way to do that! (Of course you could just blindly always graph all and use the visibility checkbox to hide some of them).

Frankly, You should explain your problem a little better. Why not attach a VI that contains typical data in a control AND the xy graph AND the plot selector for multiple plots. Then tell us how the graph should look like.