LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Need a little help with BT

Hi,

 

I´ve programmed the NXT via USB, it is finished. Now i´m changing the USB connectionto BT connection but I have some problems. The first time I turn on the NXT everything is OK, then I turn off and when I turn on again appears a lot of errors like "could not locate virtual serial port" or " Fantom: Could not connect to NXT.  Turn the NXT off and then back on before continuing.".

 

For closing the conection I have a "destroy NXTobject" block for both motor and the proximity sensor.

 

The second time I turn it On it takes the VISA and then stop.

 

Could anybody help me?

 

Thank you.

0 Kudos
Message 1 of 3
(5,977 Views)

Hello.

 

Turning your NXT off without disconnecting from your program can sometimes cause problems.  Basically, the NXT and the PC get confused about whether or not they are paired. This can lead to the errors you describe.

 

Also, since you mention that your program calls destroyNXTobject for both the motor and ultrasonic (proximity) sensor, I think you may be confused about what an NXT object is meant to represent. The intended use is that, at the beginning of your program, you open one NXT object. That object represents the NXT you will be communicating with, and you should use only for each NXT, regardless of how many sensors or motors you will interact with. Once your program is ready to close (or stop talking to the NXT), it destroys that one NXT object, and the connection is closed.

 

I don't understand your sentence: "The second time I turn it on it takes the VISA and then stop." Could you explain that in a different way?

------
James Blair
NI R&D
0 Kudos
Message 2 of 3
(5,974 Views)

yes, I´ll try.

 

 As I said, the first time I trun it on everything goes perfect. The second time that I try turning it on, I use a "Find NXT" block to adquire the "Visa resource string" and It adquire it good, The problem comes when it goes to "Pair bluetoth" block. It produces an error that said it is unable to find virtuals ports.

 

I Hope you understand me this time.

0 Kudos
Message 3 of 3
(5,938 Views)