LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

multiple NXTs

There are a lot of things to try to synchronize your program.

 

I don't think you're using the event structure correctly. What it will do is wait for 100 ms after all the code has finished executing to start again. You should remove the event sturcture, wire the Stop button directly to the conditional terminal of the while loop, and then put a Wait (ms) for 100 ms in the while loop if you want the loop to execute every 100 ms.

 

I would write to port A and port B at the same time using the Move (DC) Motors VI. Depending on which version of LabVIEW you're using, that might be at the top level or it might be on the Third Party Motors palette. It will work with LEGO motors if you are using LabVIEW 2012 SP1 or later. 

 

I don't exactly understand the design of your program, but is it a problem that you can write to a motor 6 times in a single iteration of the loop? Or wait 6+ seconds in some of the code paths?? It seems to me that for longer operations, you should be using parallel loops or state machines. You can synchronize parallel loops using local variables if you are using direct mode. 

0 Kudos
Message 21 of 22
(2,588 Views)

THANK YOU VERY MUCH! I will take your advices.

0 Kudos
Message 22 of 22
(2,585 Views)