LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Display 2 separate data sets on one XY graph

I am using Labview to construct a Raman Spectrometer and a feature we want to add is a a database that the user can select a compound from and see the locations of peaks as a line on the display. The issue I'm having is getting a graph to display two data sets. I'm including the VI as a reference to see the type of data that will need to be added to a graph on a separate VI.

0 Kudos
Message 1 of 5
(3,297 Views)

Please don't attach VIs that are maximised to the screen (front panel and diagram) very annoying!

Your FOR loop makes absolutely no sense. What is it supposed to do?

You don't need any dynamic data for XY graphs, they accept a rich variety of more normal datatypes.

 

You have 1D and 2D arrays. What is x and what is y? How many plots are supposed to be there per dataset?

Please attach your data file and attach a VI that actually contains an xy graph somewhere. Thanks! 😄

 

0 Kudos
Message 2 of 5
(3,290 Views)

Hey! Sorry for taking so long to reply.

 

So it won't let me post the spreadsheet files to the forum so I'll do my best to describe them and everything going on in the vi. So the purpose of the for loops is to build an array of maxed out signals, in our case our camera maxes out at 65535. This array is combined with an array that is comprised of x coordinates to provide a maxed out signal at a certain coordinate which is from our standard database. It will then plot a line from the top to the bottom of the xy graph and the line will be where a user would expect a peak on their own data. I found that even if I combine two differently sized arrays, the smaller one determines how many data points are considered which our database will always be smaller. The for loop goes through 100 runs to just have some arbitrary large number.

Each data set will consist of one plot. and those plots will be graphed on top of each other, one will be an actual collection of data, the other will be the simple bar graphs showing where peaks should be expected as explained earlier. The data set for every x component will run from 0 to 3750, and the y will run from 0 to 65535. Sorry for all the confusion and the maximzed windows, I've only been using labview for 4 weeks and I'm still learning a lot. feel free to make comments on mistakes I'm making so I can avoid them in the future.

0 Kudos
Message 3 of 5
(3,224 Views)

We figured out a solution! We had been on the right track by trying to bundle the arrays but kept getting weird messages, all we had to do wa sturn the 2D arrays into 1D arrays.

0 Kudos
Message 4 of 5
(3,212 Views)

Earlier you attached basically the same VI again, and looking at it again raised serious doubts about the quality of your "solution".

 


@s.thib wrote:

So the purpose of the for loops is to build an array of maxed out signals, in our case our camera maxes out at 65535


Well, you don't need a loop, shift register, etc. for that, here's a better way. Same result!

 


@s.thib wrote:

We figured out a solution! We had been on the right track by trying to bundle the arrays but kept getting weird messages, all we had to do wa sturn the 2D arrays into 1D arrays.


You are not "bundling" anything anywhere. What are "weird messages"? Do they have an error number, description? as I said, get rid of all the dynamic data and express VIs. There is no need for them.

 

If you want to attach a VI with data, create indicators right after the file IOs, run the VI so they contain data, then convert them to diagram constants (right-click...change to constant). Now you can delete the file IO and the data is contained in the VI.

 

 

0 Kudos
Message 5 of 5
(3,205 Views)