LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

xy graph question

After thumbing through a ton of posts about multiple plots on one xy graph I am still completely confused.  I am brand new to lab view...which is my first problem.  Anyways, I understand that I have to create an array, I just dont understand where I am supposed to put the array.  Looking through the files people have uploaded I see shift registars in most as well, why?  I have attached my LabVIEW code to give yall an idea of what I am trying to do.

 

Basically I am collecting data for a rotational stiffness chart, so rotation in degrees on the x axis and torque on the y axis.  I have 4 sources of data coming from a NI USB6009, 3 potentiameters calibrated to measure rotation and 1 torque cell calibrated to measure torque.  Thanks for the help!

Message Edited by Clemson11 on 06-18-2009 03:45 PM
0 Kudos
Message 1 of 9
(4,902 Views)

The easiest way to see how to wire up an XY chart is to use the context help. If you have the context help on you will see this when you hover over the XY chart's terminal on the block diagram:

xy.PNG

 

This tells you that if you want an XY graph of just one plot you need to build a cluster of 2 arrays: an array of X values and an array of Y values. If you want a multiplot then you build an array of individual plots.

 

Shift registers are used if you need to plot an XY chart over time. An XY chart has no memory so you need to make it yourself. A shift register is used to remember the previously plotted values. The Build XY Chart Express VI uses a shift register internally for this purpose.

 

In your VI you seem to already be plotting data onto a waveform chart, but I'm a little confused about your data. You said that rotation is X and torque is Y. You said you have 4 sources of data: three pots to measure rotation and 1 for torque. You can't have multiple X axes. Are you looking for a 3D plot perhaps?

0 Kudos
Message 2 of 9
(4,886 Views)
Also don't forget that you can graph complex numbers directly in an xy graph. Sometimes that simplifies the code. 😄
0 Kudos
Message 3 of 9
(4,881 Views)

I turned on the help context and folled the direction, but it still says there is an error, but the error doesnt make sense.  It says:

 

"You have connected two terminals of different types.  The type of the source is 1-D array of cluster of 2 elements.  The type of the sink is 1-D array of cluster of 2 elements."  This makes no sense because in my mind the souce and sink are the same, so I must still be missing something.  I have attached my VI.

 

In regards to the 3 x-axis:  I still only want one x-axis and one y-axis...so one graph...but I want to put three stiffness plots on this one graph.  I think where I confused you was, the torque measurements will come from the same source for all three plots, but each plot will have its own rotational measurement source.

 

Hope this makes it a little clearer, thanks!

0 Kudos
Message 4 of 9
(4,846 Views)
You cannot have dynamic data in the cluster.
0 Kudos
Message 5 of 9
(4,840 Views)

I don't have DAQ installed, so I cannot see how your DAQ is configured. A lot of things don't make sense.

 

  • Can you attach a VI that uses "simulate signal" instead so I can run it?
  • Your shift regsiter needs to be initialized with and array of 4 zeroes.
  • What is the idea behind the "built array" nodes right before the bundle operations?
Message 6 of 9
(4,834 Views)

According to the configuration of the DAQ Assistant Express VI, you are only getting one sample for each signal. This doesn't make sense, as you are following up with a Filter Express VI. You cannot filter a signal that consists of only one sample. If you are truly getting only one sample then you need to change your program so that you append your new sample to the previously collected data, or you need to change your DAQ Assistant configuration to acquire more signals.

 


Clemson11 wrote: 

 

In regards to the 3 x-axis:  I still only want one x-axis and one y-axis...so one graph...but I want to put three stiffness plots on this one graph.  I think where I confused you was, the torque measurements will come from the same source for all three plots, but each plot will have its own rotational measurement source.


Sorry, but this makes even less sense. This implies that rotation is Y and torque is X, which contradicts what you said before. And your code is set up to try to create 3 graphs, with different X values, but the same Y value. 

Message Edited by smercurio_fc on 06-19-2009 11:07 AM
0 Kudos
Message 7 of 9
(4,827 Views)

Ok, I am very sorry it is taking me so long to understand this.  All that stuff in my VI between the DAQ and the xygraph is for a tare function.  I am not sure if it is the simplest way to do this, but it works.  I have removed all the unnecessary stuff in my VI. 

 

altenbach - Unfortunately I do not know how to simulate 4 sources of data.

 

smercurio… - With my current setup, the DAQ streams data continuously, but the sources of this data produce a lot of noise, which is why i have the filter installed, though to be honest I am not exactly sure how all this works.

 

But before we tackle all the things wrong with the VI, lets focus on this graph.  I have attached two files, the first shows three separate xy graphs.  The second shows all the data going into one graph...this is the solution I am hoping for.  However, as altenbach has said, I cannot have dynamic data in a cluster.  So I have converted from dynamic data.  Now the program will run, but nothing displays on the graph.  Any ideas?

Download All
0 Kudos
Message 8 of 9
(4,817 Views)

You are only graphing plots with a single point each, you won't see them unless you pick a plot style with real points, and not just lines.

 

The express VI to built xy graphs maintains a history buffer. You can do this yourself using a shift register.

 

Here's a very primitive example, modify as needed.

Message 9 of 9
(4,803 Views)