LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get an XY graph to auto append data?

"Here is my problem. I have a Visual C program getting info from a user. That info is appended to a log file everytime the user hits "enter". Now, my labview program has to display the data in a graph, but I only want to see the 30 most recent points. I am using Labview 6i profesional and any help would be veru much appreciated
0 Kudos
Message 1 of 4
(3,159 Views)
I'm assuming that you're taking the info from the file and sticking it in an array. In that case, all you need to do is find the size of the array, subtract 30 from that and use that as the array index for the Array Subset function. The array that is the output of the function is the input to the graph.
0 Kudos
Message 2 of 4
(3,159 Views)
Dennis,
Thanx for your help. I think I understand what your saying, but just to clarify, I have to structure an array so that it will contain the 30 most recent points and then send that to a graph. So I am guessing I should set up a for loop to do that? Also, I need to plot on the same graph upper and lower limits, which are a constant point. I'm having trouble doing that because it isn't recognizing the data type when I try to bundle it up with the Visual C data, and send it all to the XY graph. Thanx again for the help
Andy
0 Kudos
Message 3 of 4
(3,159 Views)
Okay, what I had to once was read a file that was updated by a different program. I used a state machine where one state would read the entire file at some interval. If you wanted, you could also trigger a file read when the size changes. The contents of the file went into arrays using something like the Spreadsheet String To Array function. The last x number of points were extracted with the Array Subset function. The output of the Array Subset was fed into a shift register. In another state, I used the shift register to update the XY graph. What I've done for upper and lower limits is to set a couple of cursors to those values and display them on the graph.
0 Kudos
Message 4 of 4
(3,159 Views)