04-05-2007 08:34 AM
04-05-2007 09:54 AM
Dear All,
Clearly I'm not very capable at all. I've incorporated the VI above into the main VI (I could have put it in as a sub VI but I prefered not to); it can be found in the "Aquisition" Case. Anyway it doesn't work. Can any clever body see what's wrong with it? Nothing is plotted although the x-axis of the graph does refresh at each step in the corresponding loop and the indicators do show values being created/transfered.
04-05-2007 11:04 AM - edited 04-05-2007 11:04 AM
If you want to show multiple traces, you're going all wrong about it. The VI as it is now, will show only 1 value on the x-axis, namely the time delay that you set. And on that x-value, it will show the first 8 x-values from your array...
One trace is a cluster from an x-array and y-array. To show multiple traces, you put those clusters in an array.
Like this:
Message Edited by Anthony de Vries on 04-05-2007 06:05 PM
04-05-2007 11:24 AM
Sorry,
I'm struggeling to understand what you mean.
I have an array of Y values which I need to plot simultaneously against a single X value at each step in the For loop (Number of Steps) - that is as the data is created I want to plot it. I can't wait for the array to be generated before I plot it.
04-05-2007 01:13 PM
OK the issue is that you are mixing the ideas of a chart and a graph. There are some examples that show the difference, but basically a chart takes a single point at a time and adds it to the end of the plot. The chart itself keeps a history, so you don't have to. However a graph only displays the data you give it and has no history. So you are giving the XY graph 1 point at a time, therefore you only get the one point. You need to keep a history for yourself. See Anthony's reply to see how you can pass n arrays into the graph.
So add a few shift registers to the for loop, and build an array of positions for the x values, and then build an array of all the array3 values. So as you get a new point you add it to then end of the arrays, and then you give those arrays to the bundle functions and then on to the graph.
04-05-2007 02:27 PM
The question is, since I have a scaler as my X value and an array as my Y value where do the these "few" shift registers actually go. Is the aim to create an array of identical X values for each Y array? I'm all confused.
04-05-2007 02:28 PM
The question is, since I have a scaler as my X value and an array as my Y value where do the these "few" shift registers actually go. Is the aim to create an array of identical X values for each Y array? I'm all confused.
04-05-2007 02:44 PM
04-08-2007 11:08 AM
Ok, here's the finished version. It's probably not much use to anybody without the same DAQ card as me but the code emphasises how important it is to know exactly what the variables being transfered to each function actually look like - that is, their dimensions.
Sections of the code might be useful to someone who is plotting several traces on a single graph as the data is generated. The most important point is to ensure the X and Y arrays that are to be "bundled" are the same size. This is what was causing the code not to work previously.
I'm sure some good sole's going to show me how I could have done it better.
04-09-2007 09:03 AM