01-23-2011 08:32 AM
I'm making a nuclear reactor simulator program in labview that allows you to size up the reactor to the power output. The part I'm working on now is creating the circular array of pins to get a realistic pin number and geometric distribution. I've already figured out the series solution to the pin layout in Mathscript, but I can't get the imaq image of the pins to update dynamically when you change the number of "shells" in the array.
I encased the pin generator in a while loop and it updates dynamically in one direction only- you increase the number of shells and pins are added but it stays at the highest number you've input when you decrease the number of shells.
I'm reasonably sure this is some type of imaq glitch. Any help would be appreciated!
Solved! Go to Solution.
01-23-2011 10:33 AM
I believe that it's a problem with my array generation rather than an imaq thing. Is there any way to clear the mathscript arrays on each iteration of the for loop?
01-24-2011 04:57 PM
It is not a problem with your mathscript arrays. It looks like for every loop iteration you are just overlaying more overlays onto the image. So when you decrease the number of shells, it is just drawing more ovals over the tops of your image. You will need to delete the overlays before writing a new overlay on each iteration. Use the function called "IMAQ Clear Overlay" at the beginning of each loop as shown in the image below. You will also need to place a pause in your loop so it has time to draw and it doesn't flicker (a 50 ms pause should be fine). Another option instead of adding a pause would be to place this code inside an event structure that only updates when the value of the number of shells is changed. Good luck!
01-24-2011 06:26 PM
Thanks a million! It turned out that I needed to clear the overlays whenever there was a change in the number of shells. This was easily accomplished with a case structure (the event structure solution was kind of buggy). Next is the neutron flux map!