LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Bluetooth connection issue

Hi all,

I´m testing the NXT Labview toolkit in Labview 7.1. When I use the USB I have no problems running all the direct command examples that come with this kit. My problems began when I tried running the same examples using the bluetooth connection.

For example, I'm trying with the NXT Keyboard.vi but, after some time, it appears the following message: "Error. Could no connecto to: NXT".

I´ve found out that the bluetooth search timeout (10 sec) in the Find NXT.vi (NXTToolkit.DC.FindNXT.vi) is not enough to connect to the NXT, but if I change it to 20 sec, it gets the VISA resource string without any problems.

How can I solve this problem? Since I can not modify this parameter in the original function, I couldn'n find the way to connect to the NXT.

Could you help me with this issue?

Thanks in advance.

Mario

Message Edited by Tassadar on 06-25-2007 10:29 AM

0 Kudos
Message 1 of 3
(6,949 Views)
I'm a little confused as to why you can't modify the timeout parameter -- is it just because a VI is marked read-only, or you're afraid of modifying the examples?  In any case, FindNXT takes the search timeout value as an input, but defaults to 10 seconds if that input is not wired.  It probably isn't the best idea to change the default value in the FindNXT.vi, but you can always modify the calling VI and wire in some other value that works better for you (like 20 seconds).  Up to a point, increasing this timeout value is always going to increase the reliability of your Bluetooth search results, just as you saw.  If you are just concerned that the default search values aren't high enough in the Direct Command examples, there's not really any reason you can't change them to increase the timeout value.  If you are going to be distributing your code to other users and think that 10 seconds is too low of a default, just build a simple VI that always calls FindNXT with a higher timeout value.  In the end, though, I'd recommend allowing your users to choose: expose the timeout value as a setting somewhere in your UI, and users can select the value that works best for them.
------
James Blair
NI R&D
Message 2 of 3
(6,929 Views)
Thank you for your help James. It was very useful.

Mario
0 Kudos
Message 3 of 3
(6,907 Views)