From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Sample time? (read sonar halts)

I have a very simple program, that reads the distance from the Sonar-sensor. If the distance is above 20 cm, the motors A and B will turn backwards until the distance is above 20 cm.

 

This works just fine in debugging-mode, but not when the program is targeted to the NXT itself. I think this has to be something about sampletimes? I can add a Wait for 200 ms" and its get bettet. But there must be some kind of documentation about this?

 

Any thoughts is appriciated.

 

 

Regards, Alex.

0 Kudos
Message 1 of 6
(5,956 Views)

Hi Alex

 

It should not be nessasary with a wait function.

 

Could you please check if the following example program works on your device:

Help --> Find examples --> Directory Structure --> NXT Robotics --> Motors --> Case_Structure_Motor_Control.vit

 

It has approximately the same structure as your application.

 

Best Regards,

Anders Rohde

Applications Engineer

National Instruments Denmark

0 Kudos
Message 2 of 6
(5,947 Views)

Hi Anders.

 

Thank you for your reply.

 

The example program works just fine. It could seems like the Read Sonar is different than the other Read sensor? I found another guy with the exact same problem:

http://stackoverflow.com/questions/8404029/why-does-this-program-work-in-labview-when-targeted-to-co...

 

 

Regards, Alex.

0 Kudos
Message 3 of 6
(5,941 Views)

Anyone?

0 Kudos
Message 4 of 6
(5,920 Views)

Hi Alex

 

What version of the NXT module are you running?

 

0 Kudos
Message 5 of 6
(5,907 Views)

I'm using LabVIEW 2011 with the LabVIEW NXT Module 2011.

 

Downloaded from:

http://joule.ni.com/nidu/cds/view/p/id/2637/lang/en

0 Kudos
Message 6 of 6
(5,903 Views)