LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically updating imaq image for nuclear design

Solved!
Go to solution

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! 

0 Kudos
Message 1 of 4
(2,415 Views)

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?  

0 Kudos
Message 2 of 4
(2,406 Views)
Solution
Accepted by topic author C_Wynn

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!

 

IMAQ Clear Overlay.png

Zach C.
Field Engineer
Greater Los Angeles

0 Kudos
Message 3 of 4
(2,373 Views)

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!

0 Kudos
Message 4 of 4
(2,363 Views)