Author Topic: Problem installing WinUSB - USBOsrKitDemo function  (Read 3783 times)

nath.cf

  • Newbie
  • *
  • Posts: 12
    • View Profile
Problem installing WinUSB - USBOsrKitDemo function
« on: May 12, 2011, 06:26:39 pm »
Hello,

I'm trying Nrcomm lib pro trial version. I want do read data from an USB device, so i used the USBOsrKitDemo function to install WinUSB on the selected device.

When i try to activate the device it gives me the message: 'Driver is unknown'. Thas why i added the event install driver(WinUSB) but every time i try the nrUSBDriver1.Install(); function an error occurs 'Creating file error'.

I suppose it calls for an INF file while installing the driver, if that's correct where should this file be placed? There's no file related to WinUSB installation on nrcomm folder or even on my computer. I really couldn't understand how does the function works. 'cause winUSB needs some files to be intalled...

Thanks :)

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #1 on: May 13, 2011, 02:19:05 am »
Hello

At first please check that you run demo with administrator rights.
Demo uses system temp folder for create temporary files.
Also possible demo creates LOG file in same folder where EXE placed.

Roman Novgorodov
DeepSoftware
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

nath.cf

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #2 on: May 13, 2011, 08:02:35 pm »
I run demo with administrator rights but it keeps giving me the same error. I also think there´s nothing wrong with the folder permisson... I just can't solve the problem!

I'm using:
Windows 7
Delphi 2010
Nrcomm lib v 9.17 - professional edition

Thanks
Nathalia Campreguer França

nath.cf

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #3 on: May 16, 2011, 03:02:13 pm »
I found then error just couldn't solve it yet :/

on nrusbdriver.pas the function 'SavedriverFiles' calls 'CreateFileFromRes' then on nrwin32.pas the function 'CreateFileFromRes' calls 'FindResorce' tha should return a value different of zero.

After debugging the project i found the problem on 'nrwin32.pas' file inside the function 'CreateFileFromRes' line 369. The function 'FindResource' returns zero. I can't understant what it means.

Thanks again :D




Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #4 on: May 16, 2011, 04:38:17 pm »
Hello

Thank you for your information.

Do you try USBOsrKitDemo-WinUsb\usbosrkitdemo_winusb.dpr or USBOsrKitDemo\usbosrkitdemo.dpr demo?

The first one uses WinUSB engine.
The second uses nrUsb light driver.

Roman Novgorodov
DeepSoftware
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

nath.cf

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #5 on: May 17, 2011, 07:06:26 pm »
I tried to run both but theres an error saying the event 'onclick' doesn't exist for the items of the type 'TnrSemaphore' so the project can't be compiled. Isn't there another example using WinUSB?

Couldn't solve my problem yet :(

Thank you!

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #6 on: May 18, 2011, 09:35:44 am »
Hello

It seems like you have troubles with library installation.
Do you see nrComm Lib in Delphi component palette?

Roman Novgorodov
DeepSoftware
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

nath.cf

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #7 on: May 19, 2011, 05:27:22 pm »
I can see the pallete but the event 'on click' doesn't exist for TnrSemaphore. Maybe i installed an old version...I dont remember if i download it directly from nrcomm website. il uninstall ond download the latest version to see what happens

Thank you!

nath.cf

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #8 on: May 19, 2011, 06:43:23 pm »
I donwloaded nrcommlib_pro.zip and installed it all again but i still can't run the demo. now the error is on the element nrUSBPipePair it says the property policy doesn't exist.

So i created a new project that only tries to install the driver on the selected USB device. When trying to install the following error message is returned: "Driver installation failed. Access denied"

but now i don't have access to the library .pas archives so i can't find what is wrong. Do i have access to the function install driver on the trial version? or i can use it only after buying a license?

Thank you.

Nathalia C. França 

nath.cf

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #9 on: May 19, 2011, 09:04:16 pm »
I tried something different but i don't now if that's correct.

usbpipedemo reads data from an USB device without installing WinUSB? 'Cause it seems to word just fine with my pen drive.

So i thought i could adapt the code to my application(i can't use the device box) and read data from my USB device and then forget about WinUBS problems!!

Hope that's possible :|

I appreciate your attencion!

Nathalia C. França

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #10 on: May 20, 2011, 01:33:13 am »
Hello

You can ignore warning about Policies property.

You need start Demo as Administrator for install drivers.

Roman Novgorodov
DeepSoftware
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

nath.cf

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #11 on: May 20, 2011, 07:18:56 pm »
When i run it with administrator rights the driver was installed. But now i can't see my pen drive on 'My Computer' and when i try to activate the device on usbpipedemo nothing happens(aparently no data is returned). What might be happening now? any idea? I'll try to find what's wrong...

and you didn't answer my previous question:

I tried something different but i don't now if that's correct.

usbpipedemo reads data from an USB device without installing WinUSB? 'Cause it seems to word just fine with my pen drive.

So i thought i could adapt the code to my application(i can't use the device box) and read data from my USB device and then forget about WinUBS problems!!

Hope that's possible :|

I appreciate your attencion!

Nathalia C. França

Thanks!! :)

Nathalia C. França

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #12 on: May 21, 2011, 05:57:26 am »
Hello

You told about "pen".

Is this HID device (Human Interface Device)?

In this case you do not need USB solution at all !

You need try HIDDemo. Please remove nrComm usb driver, re-insyall your device in initial state and try HIDDemo.

Read more here:
http://forums.nrcommlib.com/index.php?board=20.0


Roman Novgorodov
DeepSoftware
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

nath.cf

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #13 on: May 24, 2011, 07:07:31 pm »
No, i really need an USB solution. I'm just using it for tests and the device its recognized as an USB device.

I don't now if i made you understand what i'm really trying to do.  I just want to read data from an specific USB device(its a device conected  to a sensor that monitors the level of water in a well) and use this data on my application. That's why i'm trying to adapt usbpipedemo so i don't have to use nrDeviceBox. but i can't understand how it should work! and i got really confused with WinUsb stuff! i don't now if i should use it or not...

I started something using usbpipedemo and usbosrkitdemo codes but i don't now if its correct...

Thank you for all the attention

Nathalia Campreguer França


Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Problem installing WinUSB - USBOsrKitDemo function
« Reply #14 on: May 31, 2011, 10:09:26 am »
Hello

I'm sorry if my answer is too late.

Yes, it seems like you do not understand how USB device work.

Before use nrComm Lib components, you need install compatible driver. nrComm provides two solutions: lightweight original driver and WinUSB framework. How drivers can be installed you can see in two demos:
http://deepsoftware.com/nrcomm/usbosrkitdemo.zip
http://deepsoftware.com/nrcomm/usbosrkitdemo-winusb.zip

Please note that demos are intended for special USB device (OSR USB Learn Kit board).You need open demo sources and change IdVendor and IdProduct values on correct numbers of your device.

If driver is installed correctly USB device can be opened without exceptions and you can try make I/O operations. You can try USBPipeDemo:
http://deepsoftware.com/nrcomm/usbpipedemo.zip
You just need select correct PIPE id for necessary operation.

Roman Novgorodov
DeepSoftware
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.