LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Fantom SDK

This forum is for discussion of Fantom SDK.
0 Kudos
Message 1 of 28
(13,835 Views)
Hi All:

The LabVIEW vi's contained in the Fantom SDK require access to the fantom.dll file installed by the LEGO Mindstorms NXT system software. It is not included in the SDK.

On MS Windows, it is installed in the \WINDOWS\system32\ folder.

Best regards,

-Bill =]
0 Kudos
Message 2 of 28
(13,796 Views)
With thanks to Kjeld Petersen/SDU/DK,

The Fantom SDK is available at Download Driver SDK (fantomSDK1.0.2f0.zip 2.21MB) 
from the
Mindstorms NXTreme Overview Site  



-Bill =]
0 Kudos
Message 3 of 28
(13,784 Views)
Could anyone open the Vi and LLB files that came with the SDK?  I tried to open the files with Labview 7.0, 7.1, and 8.0, all returned version incompatible errors.  Anyone had similar or different experiences?
 
 
LC
0 Kudos
Message 4 of 28
(13,782 Views)
Hi Larry,

After explicitly telling LabVIEW 8.0 where to find the fantom.dll, I am having no trouble running the vi's and I am able to connect with the NXT.

Here is the vi order I am using:

0. Turn on BlueTooth on NXT and turn on BlueTooth on desktop system

1. findNXT.vi - run and use to get resource name

2. pairBluetooth.vi - paste resource name into control and run. I get passkey confirmation on NXT, press accept (checkmark) and Windows informs me that it has found New Hardware and that is is ready to be used

3. isPaired.vi - paste resource name into control and run. Returns Boolean True for isPaired? indicator

4. unpairBluetooth.vi - paste resource name into control and run

5. isPaired.vi - confirms NXT is no longer paired

I've had it working for about 5 minutes now.... I'm off to get play some more...

-Bill =]
0 Kudos
Message 5 of 28
(13,774 Views)
Hi Bill

As you can see on my next question I'm not that good a LabVIEW programmer.
Actually I started just 1 month ago.

So: How did you tell LabVIEW where to find the fantom.dll file?

Kind Regards Kjeld
0 Kudos
Message 6 of 28
(13,758 Views)

@Kjeld Petersen/SDU/DK wrote:

... How did you tell LabVIEW where to find the fantom.dll file?




Hi Kjeld:

On MS Windows, the NXT install places the fantom.dll file in the \WINDOWS\system32\ or \WINNT\system32\ folder, depending on the name of your Windows directory.

I'm pretty sure the default search path for LabVIEW includes the \system32\ directory and it should probably find it automatically when you try to load any of the Fantom SDK vi's that need it.

If it does not, you can force LabVIEW to specifically include \system32\ in its search path by adding that path on the Tools/Options... menu in LabVIEW.

You can be really specific by double clicking on the "Call Library Function Node" vi in the code and using its pop-up dialog box to browse for the exact location of the fantom.dll.

Also, if disk space is not a problem, you can place a copy of the 110 KB fantom.dll file in the same folder as your vi and LabVIEW will search for it there first.

I hope this helps.

p.s. I've been able to build a single vi that finds and binds the NXT via Bluetooth as described above, but no luck so far in using the more advanced calls to the fantom.dll. I need to spend more time reading over the LEGO MINDSOTRMS NXT Executable File Specification.pdf to understand what to say, but I think we are close to answering your original idea of sending sensor values over Bluetooth.

Regards,

-Bill =]
0 Kudos
Message 7 of 28
(13,749 Views)
Hi Bill

Some of the functions do work, so LabVIEW must be able to find the fantom.dll.

I'm having problems with the SendDirectCommand.vi

Kind Regards
Kjeld
0 Kudos
Message 8 of 28
(13,745 Views)

@Kjeld Petersen/SDU/DK wrote:
Hi Bill

Some of the functions do work, so LabVIEW must be able to find the fantom.dll.

I'm having problems with the SendDirectCommand.vi

Kind Regards
Kjeld





Hi Kjeld,

We are attacking the same problem at the moment. Even though the vi's work to Pair the NXT with LabVIEW via Bluetooth, the other vi calls to the fantom.dll fail (as in SendDirectCommand.vi that you mention.) I believe it has to do with using the fantom.dll calls in the correct order and using parameters in the correct format. That is why I am looking to the documentation in the Executable File Specification for a solution...

-Bill =]
0 Kudos
Message 9 of 28
(13,741 Views)

Hi Bill

Now it works. I had a look into the help documentation, and look what I found.

// This is a direct command to play a tone.
ViUInt8 directCommandBuffer[] = { 0x03, 0x00, 0x18, 0x10, 0x00 };

// Send the direct command to the NXT.
nxtPtr->sendDirectCommand(

    false
/* a response is not required for this direct command */,
    reinterpret_cast< ViByte* >( directCommandBuffer ),

    sizeof
( directCommandBuffer ),
    NULL
/* no response buffer */,
    0
/* no response buffer, specify 0 for size */,
    status );

When you send a direct command, you should not key in the first 0x00 as it is described in the "Direct commands" manual.

Regards Kjeld
Message 10 of 28
(13,732 Views)