MindSqualls
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Using MindSqualls with USB

2 posters

Go down

Using MindSqualls with USB Empty Using MindSqualls with USB

Post  Ahelios Thu Jul 28, 2011 4:31 am

Hi,
I started working with the MindSqualls API this week in the hope to make progress in my project to control stepper motors using the NxtBrick. Right now, I can connect to the Nxt brick using Bluetooth (using the MindSqualls API), but not with USB. I want to use USB because the lagging time with BT is way too large. I know my Nxt brick and USB connection in my computer are working correctly, because I can connect via USB using Brickcc. However, no matter what I try, I cannot connect via USB using MindSqualls. I already tested .NET 2.0 and .NET 3.5. I also tried a different computer with the same results: BT works, USB connection no. By reading the readmes, I see references to the winusb.sys driver. Is it a requirement to have this driver installed in my computer? Or, am I missing some other basic stuff? Here is the code I tried:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim brick As New NxtBrick(NxtCommLinkType.USB, 0) ==> does not work
'Dim brick As New NxtBrick(NxtCommLinkType.Bluetooth, "COM11") ==> works fine

' Create a motor.
Dim motor As New NxtMotor()

' Attach it to port A of the NXT brick.
brick.MotorA = motor

' Run it at 75% power, for a 360 degree run.
motor.Run(75, 360)
End Sub


Thanks a lot!

Ahelios

Posts : 5
Join date : 2011-07-27

Back to top Go down

Using MindSqualls with USB Empty Re: Using MindSqualls with USB

Post  Niels Fri Jul 29, 2011 5:06 am

Can you be more specific when you say that you cannot connect:

  • What happened?
  • What did you expect to happen?
  • Did you get an error message, and if so which one?


The WinUsb.sys driver is part of the Windows system, so you should not have to worry about that as I understand it.

I have one idea about what may be wrong. Can you find the fantomv.inf file on your PC and have a look in it. Notepad can open it. Look for the text:
[WinUsb_Inst_HW_AddReg]
and then for the line of text just below it. It should contain a Guid i.e. something that looks like this:
{761ED34A-CCFA-416b-94BB-33486DB1F5D5}

What does it say?

Leg Godt,
Niels

Niels

Posts : 19
Join date : 2011-07-15

Back to top Go down

Using MindSqualls with USB Empty Re: Using MindSqualls with USB

Post  Ahelios Fri Jul 29, 2011 10:16 am

Hi,
Thanks for the answer. I mean my app is unable to communicate with the brick using USB. The app has a button that when clicked makes a motor to run for a few seconds. Nothing happens when I click the button. No error messages are shown and the app does not hang. if I use BT as NxtCommLinkType, the motor runs as expected when I click the buttom.
I do not have a fantomv.inf file in my computer. Only fantom.sys and fantom.dll
BTW I am using a Windows XP computer, not Windows 7. It seems that winusb.sys is native to Windows 7 but not to XP. I will try two things now: test the app over USB connection on a Windows 7 computer, and install the winusb driver in the XP machine.
Do you happen to have tested USB connection with XP? If you have winusb installed with XP, do you have the .inf file for winusb.sys?
Thanks again,
Marcelo


Ahelios

Posts : 5
Join date : 2011-07-27

Back to top Go down

Using MindSqualls with USB Empty Re: Using MindSqualls with USB

Post  Niels Fri Jul 29, 2011 4:14 pm

Hmmm. If WinUsb is not on your machine I would have expected an exception to be thrown.

One more thing you can do is to look in the folder:
C:\Windows\Inf

There ought to be some files there that are named:
oem#.inf
where # is a number. One of them is the one for the NXT but you will have to open all of them at have a look inside to see which. You can recognize it from the header where it says "National Instruments Corporation".

I am using Windows 7 myself and I have not been able to test the USB on another OS.

Niels

Posts : 19
Join date : 2011-07-15

Back to top Go down

Using MindSqualls with USB Empty Re: Using MindSqualls with USB

Post  Niels Fri Jul 29, 2011 4:15 pm

BTW, the inf-file is isntalled when you install the NXT software on the machine.

Niels

Posts : 19
Join date : 2011-07-15

Back to top Go down

Using MindSqualls with USB Empty Re: Using MindSqualls with USB

Post  Ahelios Sun Jul 31, 2011 3:45 am

Hi,
I looked up all INF files in my XP computer and there is none by "National Instruments Corporation". But I did find docs about how to install the winusb.sys driver in Windows XP so I will give it a try.

But at any rate, I tried my app in a Windows 7 computer and it worked right away using usb! So I guess I will move my project to Windows 7 if I cannot make the winusb.sys driver work in XP. Thanks for your help with this!

Marcelo

Ahelios

Posts : 5
Join date : 2011-07-27

Back to top Go down

Using MindSqualls with USB Empty Re: Using MindSqualls with USB

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum