LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Speed up code?

Hey, all! We are using the following code to control some victor via a joystick. The code runs VERY slowly...our theory is that there are too many loops or that having the "highlight execution" option on is slowing it down. Any suggestions as to speed it up? Sorry for the different sizes of the pics...

Slowness0.JPGSlowness1.JPG

0 Kudos
Message 1 of 4
(3,405 Views)

If you have Highlight Execution turned on, the code will run far slower then normal.  It's only meant for debugging/troubleshooting.  Definitely turn that off.

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

On the 2nd picture I noticed that you're closing the input device inside the loop.  I would think that you want to do that outside of the loop to the right where you close other things.  Closing the device on every loop will force it to reinitialize again on the next loop (on every loop) which probably slows things down noticeably.

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

Thank you very much, both suggestions helped!

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