LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I programatically draw new circles on a picture control

Solved!
Go to solution

That is a blank picture constant that is basically the background image in your app.  If you have a background that you want to always appear, you could load that image and use it as the default image and the bouncing balls will be drawn on top of that background.

aputman
Message 11 of 12
(911 Views)

Correct.  A For Loop will only iterate the number of times based on the smallest of the value wired to N or the shortest array for auto-indexing going in.

 

1.  I feel Wait is more consistent.  Wait until next theoretically happens on a regular beat.  But if for some reason a loop iteration takes a bit longer than the wait value, then it will wait  another whole beat before it hits again.

 

So if you had a 1 second wait, and the code inside takes 500 msec.  The loop will iterate after 1 second.

If you had a 1 second wait and the code inside takes 1001 msec, the loop will iterate after 2 seconds.

 

With a regular wait, the loop will take 1 second and 1001 msec respectively.  For most code, you want something that looks like it is running smoother and you don't care about keeping on a specific beat relative to the PC clock.  If that is an issue in your code, and your code takes too long to run, you've got other problems to worry about beside which wait function to use.

 

2.  That is an empty picture constant.  (Made by picking the shift register and picking Create Constant.) That way the data in the shift register is cleared each time the For Loop starts.  Otherwise all of your other balls will still exist in the picture data from the last time the For Loop ran.  Without it, it is called an "Uninitialized Shift Register" and it is a way to store data between calls of the For Loop.  The shift register itself is what stores data between iterations of the For Loop.

Message 12 of 12
(909 Views)