NI Home > Community > NI Discussion Forums

LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

Showing results for 
Search instead for 
Do you mean 
Reply
Member
UlfM
Posts: 16

Re: LabVIEW Toolkit for LEGO MINDSTORMS NXT bugs

[ Edited ]

James,

I tried several things on this, running 7.1.1f2 and 8.2 under XP SP2. I concentrated on "findNXT.vi" in the fantom driver interface. My top level VI looks like this:

 

Under 7.1.1f2 the resulting exe is able to find the NXT via BT within 15 seconds, whereas built under 8.2 the exe behaves as Miki describes it: within a few ms it returns without having touched BT (NI Spy shows nothing looking like accessing BT).

BUT: If I remove "findNXT.vi" (distributed in the toolkit) and instead of that use the version distributed by LEGO in fantomSDK1.0.2f0 (...\fantomSDK1.0.2f0\fantom\includes\labview\win32\findNXT.vi, directory mass compiled for 8.20), the resulting 8.20 .exe behaves like the exe built using LV7.1.1f2: it also finds the NXT within the same 15".

Regards

Ulf

Message Edited by UlfM on 12-18-2006 11:46 PM

Member
JamesB.
Posts: 127

Re: LabVIEW Toolkit for LEGO MINDSTORMS NXT bugs

Miki, Ulf, and others:

I think I've got the "Bluetooth not working in built executable" problem solved!  The issue is that the version of findNXT.vi distributed with the NXT Toolkit includes some additional logic to ensure that Bluetooth is available on your system, and an important piece of that logic doesn't get built into your executable by default.  To resolve the problem, you need to add a VI to the list of VIs that are called dynamically in your built executable.  The path for the VI in question is:

<LabVIEW>\vi.lib\addons\NXTToolkit\shared\NXTToolkit.BluetoothLibraryReferences.vi

From this point on, these instructions are LabVIEW 8.x specific; if you're using LabVIEW 7.1, look for similar options when creating your Build Specification.

First, add the VI above to your project.  Then, edit your Build Specification and select the Source Files category on the left.  Select the VI, then add it to the list of "Dynamic VIs and Support Files" using the blue arrow.  Now, that VI will get built into your executable, the extra logic will be there, and Bluetooth searches will work.

Thanks to Ulf for the debugging info and to Brady Duggan for his help in tracking this one down.
------
James Blair
NI R&D
Member
UlfM
Posts: 16
0 Kudos

Re: LabVIEW Toolkit for LEGO MINDSTORMS NXT bugs

Thank you, James (+ others)!

I checked it out for 7.1.1, 8.0.1 and 8.20 - works great and can be done easily!

Ulf

Member tol
Member
tol
Posts: 6
0 Kudos

Re: LabVIEW Toolkit for LEGO MINDSTORMS NXT bugs

Thank You! It works great now!

Best regards,

Miki

Knight of NI
Knight of NI
tst
Posts: 10,881

Re: LabVIEW Toolkit for LEGO MINDSTORMS NXT bugs

I had a chance to play with NXT and it's quite cool.

After a short experiment with the Mindstorms software, I gave up and switched over to the toolkit, since it seems to give you a lot more control over execution of parallel tasks.

Anyway, I wrote my first piece of code as a state machine, implemented using a string array, which was how I ran into my bug - attempting to index an array element which does not exist in the array causes the program to crash with a "File Error!" message. This should of course be handled by the Index Array primitive, but a workaround is to write a wrapper which will check the index against the array size and return the default value if it's out of that range.

BTW, given my experience with the PDA module, I was surprised it took me as long as it did to actually find the bug. At first I thought my program was simply stopping after the first state for some reason. Only after looking at the display did I realize it was crashing. I should have known better. :smileyvery-happy:


___________________
Try to take over the world!
Member
mannitwo
Posts: 2
0 Kudos

Re: LabVIEW Toolkit for LEGO MINDSTORMS NXT bugs

Hello,
 
I have the same problem with LabView 8.2, German version like Daniel (reply 23):
 
"I'm using a German version of LabVIEW (8.20) too. And I have a problem in transferring NXT Toolkit code to the NXT brick. I've just written a little program for displaying a short text on the brick (see the picture). Then I started Tools\NXT Module\NXT Terminal but there's no program to choose for uploading it."
What make I wrong, gives at this moment a solution?
 
Regards
Manfred
 
Member
Daindim
Posts: 23
0 Kudos

Re: LabVIEW Toolkit for LEGO MINDSTORMS NXT bugs



mannitwo wrote:
Hello,
 
I have the same problem with LabView 8.2, German version like Daniel (reply 23):
 
"I'm using a German version of LabVIEW (8.20) too. And I have a problem in transferring NXT Toolkit code to the NXT brick. I've just written a little program for displaying a short text on the brick (see the picture). Then I started Tools\NXT Module\NXT Terminal but there's no program to choose for uploading it."
What make I wrong, gives at this moment a solution?
 
Regards
Manfred
 


Right

I was facing the same issue with another localized version of LV (French one). After installing the english version, all comes back into order. I believe this to linked with localized versions.

Regards,

Daindim

Member
mannitwo
Posts: 2
0 Kudos

Re: LabVIEW Toolkit for LEGO MINDSTORMS NXT bugs


Daindim wrote:

Right

I was facing the same issue with another localized version of LV (French one). After installing the english version, all comes back into order. I believe this to linked with localized versions.

Regards,

Daindim


 

Hello Daindim,

thanks for your answer, but I do not have the English version, I only have the German version.

I hope, that NI will bring out a patch in the near future, which will solve the problems.

Regards,

Manfred

Member Pau
Member
Pau
Posts: 1
0 Kudos

Re: LabVIEW Toolkit for LEGO MINDSTORMS NXT bugs

Hello to all: I have a small problem, I am creandome my own blocks with Labview but when compiling the error appears following error 1073807247 generates fantom if somebody knows like solving it agradeceria that it said to me like. A greeting.
Member
JamesB.
Posts: 127
0 Kudos

Re: LabVIEW Toolkit for LEGO MINDSTORMS NXT bugs

Hi Pau:

I looked up that error code using LabVIEW's Explain Error tool (Help -> Explain Error...), and it indicates that the size of a memory buffer is incorrect.  Fantom is very picky about user-specified buffers.  In most cases, you must pass it an empty buffer and a size of zero, or a valid buffer and the (non-zero) size of that buffer.

If you provide a little more information about which VIs you are calling, or what information you are trying to send / receive from the NXT, I can provide more details about what might be wrong.
------
James Blair
NI R&D