NI Home > Community > NI Discussion Forums
Reply
Member
Alex_Petersen
Posts: 7
0 Kudos

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.

Active Participant
A.Rohde
Posts: 474
0 Kudos

Re: Sample time? (read sonar halts)

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

Member
Alex_Petersen
Posts: 7
0 Kudos

Re: Sample time? (read sonar halts)

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.

Member
Alex_Petersen
Posts: 7
0 Kudos

Re: Sample time? (read sonar halts)

Anyone?

Active Participant
A.Rohde
Posts: 474
0 Kudos

Re: Sample time? (read sonar halts)

Hi Alex

 

What version of the NXT module are you running?

 

Member
Alex_Petersen
Posts: 7
0 Kudos

Re: Sample time? (read sonar halts)

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