LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting XY Data and Clearing Graph

Hello,
 
I have a question........but quickly here's what I'm trying to do - I will be aquiring two AI channels at the same time and want to plot them on a graph and then eventually save the data to disk. I think the acquisition & plotting part is OK, although there is probably a more efficient way in building the XY plot and I'm open to  any suggestions.
 
Anyway, I'm now up to clearing the data before and after each acquisition and this is where i'm stuck.
I've reviewed the earlier posts and the How to clear charts and graphs.vi and still am unable to clear it.  I've centered my attempts on the "history" property node and feeding in blank arrays at the start (pressing the "on" button) and end of the acquisition. I've reviewed the property node list many many many times and can't seem to find the "History" component for the XY chart I'm using. Feeding in blank arrays got messy quickly and pretty much just lost myself....so now I'm here!
 
Attached is a copy of the VI (Laview 8.0) if you have the time to help i'd really appreciate it....thanks in advance
 
best,
james
 
 
0 Kudos
Message 1 of 7
(3,293 Views)

As far as I know the XY Chart displays only the provided data and no older stuff. So you might have to change "XY Chart Buffer.VI" and add a clearing functionality (I have LV 8.2 and could not find this VI).

A workaround to clear the XY Chart is to use the Invoke Node Function "Reinitialize To Default" if the default is an empty chart.

Regards Jörn

Message 2 of 7
(3,274 Views)

Hello James,

i have 8.2 and could not find the xybuffer.vi you refer to. i would guess you constructed this subvi. send it so we could see what do you do in there.

however, you generally have simpe ways of displaying data: i understand the first channel is x, while the second is y? if so, use a shift register to keep the 2 separate arrays growing, and at each iteration (or every 20), just display them in a xy graph. this graph is then fed only with the data in the arrays. this is the short and dirty way of doing it, but you can begin there to see that it works. if it answers your question, you could continue and use an action engine, as refered by Ben:

http://forums.ni.com/ni/board/message?board.id=170&message.id=240328, to have unrelated data writing and reading.

but from what i see in your vi, the two DAQ inputs seems to be only y values (correct me if i am wrong). then you should just use charts instead of graphs, from which you can clear the history using a property node at begining of VI.

Does it help?

Gabriel

 

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
Message 3 of 7
(3,273 Views)
I can't view your VI as I'm only using v7.1, but I thought I'd chip in if this may be any help...
 
In one of my recent programs I used the property Value (Signaling) and created a constant which contained zeros and this did the job for me.
 
Ian
Message 4 of 7
(3,266 Views)

Hi,

thanks for all the comments and sorry about the XY buffer.vi....I attached it below. This VI came with Labview in the following library:

C:\Program Files\National Instruments\LabVIEW 8.0\examples\general\graphs\charts.llb\XY Chart Buffer.vi

Yeah I should clarify that pretty much what I would like to do is display the data (where each point is an averaged value) from the two channels as an xy graph as the points are generated.

Gabriel, I was initially trying to do what you said but as I thought about it, I think it would be preferrable (i.e. cooler!) if the user could see the data update on the chart as it is acquired. I tried to do this with a waveform but couldn't get it to work....

Right now I'm looking into changing the XY buffer VI and use the Invoke node as suggested by Jörn.

best,

James

 

 

0 Kudos
Message 5 of 7
(3,248 Views)

Ok so I scrapped the XY buffer VI as I couldn't figure out how to get it to clear correctly...

So using Gabriels suggestion I used shift registers and it works the way I need it too.....should have tried this first aye!

thanks for the help

 

0 Kudos
Message 6 of 7
(3,224 Views)
Hello James,
 
your vi it looks nice.
But, since you update the graph every single scan, you might end up with relatively slow update timing: the graph update take quite a bit of computation time. therefore, if you wish to sample faster, say in the KHz range, then you might want to update the graph only once every 10 or 100ms (the array is filled anyway every cycle, just the graph will show what is in the array only every10 or 100 cycles). use a case inside the For loop to do so.
By the way i dont understand why you use a while loop around your vi. continuous run doesnt work?
 
Dont forget to rate messages!
-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 7 of 7
(3,201 Views)