• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
April 23, 2024, 12:43:41 pm

News:

SMF - Just Installed!


Two non-trivial questions

Started by Max, February 24, 2009, 10:33:03 am

Previous topic - Next topic

Max

Hi guys! I am a new user and I really like these nrCommlib but I have two questions for you :)

I am trying the trial version of nrCommlib for USB with Borland C++ Builder 5, and I have these questions to ask:

1) I always get the error "Device is not selected"  when I try to connect to a device using TnrUSB at design time or runtime. What do I have to do?  ???

2) I think there are several methods (in TnrUSB and other Usb components) not documented yet, I need your help in order to know them all :-\  The link http://www.deepsoftware.com/nrcomm/help/index.html doesn't work and in the usb examples I've found only few TnrUsb methods...

I need your help...  ;)

Thanks

Roman Novgorodov

Hello

1) You can TnrDeviceBox control together TnrUsb for select needed USB device. You can try to look the following demo projects:
Demos\USBDeviceDemoBCB\usbdevicedemo.bpr
Demos\USBPipeDemo\usbpipedemo.dpr

You should set TnrUsb.DeviceIndex property to target device before open it.
Also the following method can be useful for select device by its Vendo and product ID's:
TnrUsb.DeviceIndexOf(VendorId, ProductId : dword):integer;

Please note that TnrUsb uses Microsoft WinUSB driver. It should be installed on target devices before opening them.

2) After installation nrComm Lib the context help (F1) should be available in Delphi/C++Builder IDE.
There are several demo projects that can help you to find useful information.
And we provide tech support over email for registered user.

Thank you for information about dead link. We will fix it asap.

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

Max

Thank you very much, I have another 'simply' question about first question. I put TnrDeviceBox and TnrUsb controls on a form, then (at runtime) I selected the device with this C++ code:


        TnrUSB *USB= nrUSB1;
TnrUSBPipePair *USBPipe= nrUSBPipePair1;
TnrDeviceBox *DevBox= nrDeviceBox1;
               
USB->DeviceIndexOf(0x..., 0x...);
USB->DeviceIndex= DevBox->ItemIndex;

       USB->Active= true;


but still I get the same error "Device not selected" at runtime. Where is my mistake? Do I forget something?
The WinUsbDriver is installed and working.

Thank you again.


Quote from: Roman Novgorodov on February 24, 2009, 02:24:22 pm
Hello

1) You can TnrDeviceBox control together TnrUsb for select needed USB device. You can try to look the following demo projects:
Demos\USBDeviceDemoBCB\usbdevicedemo.bpr
Demos\USBPipeDemo\usbpipedemo.dpr

You should set TnrUsb.DeviceIndex property to target device before open it.
Also the following method can be useful for select device by its Vendo and product ID's:
TnrUsb.DeviceIndexOf(VendorId, ProductId : dword):integer;

Please note that TnrUsb uses Microsoft WinUSB driver. It should be installed on target devices before opening them.



Roman Novgorodov

Hello

Plese try something like this

USB->DeviceIndex = USB->DeviceIndexOf(0x..., 0x...);

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

Max

I'm sorry Roman, it doesn't work  :-[
I'll try other combinations...


Roman Novgorodov

Do you see your device in USBDevice demo?
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

Max

Yes I see it and I can install the WinUsb driver with the "Install driver" button.
I am also able to see the name of other devices connected to my computer at design time with the TnrDeviceBox on the form.

Roman Novgorodov

Hello

I have checked. The DeviceIndexOf() method works ok.
Possible your device list is empty.

Please try to call Update() method for refresh the device list before call DeviceIndexOf().

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

Max

I'm sorry, the device list is not empty. I put a TnrDeviceBox component on the form (along with TnrUSBDeriver and TnrUsb Vcl component): I can see the devices connected to my pc in the TnrDeviceBox at design time. If I change the property DeviceIndex in the TnrUsb component at design time  I can see the name of the new device selected in TnrDeviceBox (it works well) but if I try to make TnrUsb active (with the corresponding property "Active") I get the error "Device not selectd" again.
I think I am doing some mistakes I don't understand yet :(

Thank for your patience and help Roman.