LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Clear XY Graph Data Between Iterations

Solved!
Go to solution

Hello,

 

I'm trying to clear XY graph data each iteration of the loop, but "reinit to default" invoke node doesn't function.

Are there any other options to clear data?

Download All
0 Kudos
Message 1 of 12
(7,653 Views)

Calling those BEFORE the loop will only clear the data once, BEFORE the loop executes.

 

The easiest way to do what you want is use the Express XY Graph which includes an input called Reset? Wire a true to this input when you want the graph to reset.

--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 2 of 12
(7,636 Views)

Hi Tim,

 

I'm aware of that. I've two nested for loops, and I want to clear all data from the XY graph each iteration of the OUTER for loop. I can't use "reset" because I don't know how many iterations the inner loop has (in case of using a case structure). I might try to use the outer loop counter to send that signal, but I thought that there is a simpler/elegant way.

0 Kudos
Message 3 of 12
(7,619 Views)

Write an empty constant to the terminal.

 

23464i5993B79A427C7636

0 Kudos
Message 4 of 12
(7,599 Views)

Hi Jack,

 

Thank you for the reply.

I've tried it. I placed the "write" bewteen the two loops, and it doesn't clear the data.

 

Download All
0 Kudos
Message 5 of 12
(7,594 Views)

If that doesn't work, then you probably have a race condition, or a shift register that is not being reinitialized. Can you post the VI, or at least a screenshot of the entire loop? (Also, try using PNG for LabVIEW screenshots - you get lossless compression, a crisp image, and typically smaller filesize than JPG!)

 

Cheers.

0 Kudos
Message 6 of 12
(7,573 Views)

Hi Jack,

 

I've attached a an image of the block diagram, and I'll be happy to upload the vi but I'm using IMAQ and subvi's so I'm not sure it'll work for everybody.....

0 Kudos
Message 7 of 12
(7,554 Views)

Yes, there is a race condition between the XY graph being cleared and the beginning of the For Loop (which one starts first?), and also, the Build XY Graph Express VI has a "Reset" input that must be triggered when the inner loop iteration =0.

0 Kudos
Message 8 of 12
(7,505 Views)

 


@simply_me wrote:

Hi Jack,

 

I've attached a an image of the block diagram, and I'll be happy to upload the vi but I'm using IMAQ and subvi's so I'm not sure it'll work for everybody.....


 

I'm guessing that if you watch it with execution highlighting on, you'll see it clear for a second when the variable gets executed.  It doesn't stay cleared though because the Express XY keeps an internal buffer that is only cleared when the Reset? option is true.  That's the third section in the following VI.  I suggest you do something like in either of the first two parts pictured.

23504i053656C7A9D1A149

--
Tim Elsey
Certified LabVIEW Architect
Message 9 of 12
(7,487 Views)
Solution
Accepted by topic author simply_me

With the 2nd option (Express XY), you could also check if i=0 and use the output of that to decide whether to reset, rather than using the shift register.

--
Tim Elsey
Certified LabVIEW Architect
Message 10 of 12
(7,466 Views)