09-08-2010 02:24 PM
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?
Solved! Go to Solution.
09-08-2010 02:41 PM - edited 09-08-2010 02:47 PM
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.
09-08-2010 06:01 PM
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.
09-08-2010 07:58 PM
Write an empty constant to the terminal.
09-08-2010 09:14 PM
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.
09-08-2010 09:40 PM - edited 09-08-2010 09:41 PM
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.
09-09-2010 12:45 AM
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.....
09-09-2010 07:34 AM
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.
09-09-2010 08:29 AM - edited 09-09-2010 08:32 AM
@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.
09-09-2010 10:46 AM
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.