• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
April 26, 2024, 03:32:51 pm

News:

SMF - Just Installed!


Reading/Writing USB Device

Started by Alycat, September 08, 2011, 09:20:21 pm

Previous topic - Next topic

Roman Novgorodov

Hello

Please check that length of outgoing data is not greater than MaxPacket size of pipe.
See USBBrowser for look at pipe properties.

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

Alycat

Quote from: Roman Novgorodov on October 01, 2011, 01:07:31 pmPlease check that length of outgoing data
Is this data going to the device or coming from the device?
Quoteis not greater than MaxPacket size of pipe
PipePair does not have a property in the designer of MaxPacket? How and when do I set it?
QuoteSee USBBrowser for look at pipe properties.
My demo programs does not included USBBrowser?

Roman Novgorodov

Hello

You can find USBBrowser shortcut in nrComm group of Start menu.
Select needed device and its pipe and see properties.

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

Alycat

Quote from: Roman Novgorodov on October 01, 2011, 01:07:31 pmPlease check that length of outgoing data is not greater than MaxPacket size of pipe.

Ok, Max Packet Size is 8, for both pipes.
Outgoing data, I am sending only about 20 char's or so in the setup.
The packet size, what is 8 measured in?

Roman Novgorodov

Hello

Please try separate your data sending to several DataSend() calls with max data length 8 char (bytes)

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

Alycat

Quote from: Roman Novgorodov on October 06, 2011, 12:29:43 pmPlease try separate your data sending to several DataSend() calls with max data length 8 char (bytes)

Please see above, the setup code does not send any data to the USB.
ListBox1.Items.Add('Setup starting...');
   ListBox1.Refresh;
   nrUSB1.Update;
   dev:=nrUSB1.DeviceIndexOf(...,...);
   ListBox1.Items.Add('Device found at index: '+inttostr(dev));
   nrUSB1.SetDeviceIndex(dev);
   ListBox1.Items.Add('Device index set: '+inttostr(nrUSB1.DeviceIndex));
   ListBox1.Items.Add('Setup finished.');
   ListBox1.Refresh;

Roman Novgorodov

Hello


... I am sending only about 20 chars ..

I don't see sending code in your sample.

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

Alycat

No, my mistake, the test program, as above, does not send any data. The real program does, but it is not being worked on because of the problem with your component and FastMM.
The USB device is running all the time, so would be sending data- I am wondering if the test program as above has hit the limit of reading data because of being the demo version.
There are two problems here it seems. If I use the "setup" button twice it stops reading. I have not tested it much lately, and now it reads about 15 or 20 records and stops. I reboot, and it reads, but only 15 or 20 records again.
TeamViewer is open if you want to look.

Roman Novgorodov

Hello

Please note that you did not install driver every time before work with USB device.
It is one-time operation.

You need install driver if USB device opening returns exception about wrong driver.

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

Alycat

I am not installing the driver each time.
The main problem is that the test program reads a dozen or so records and stops, rerunning it will not read anything, requires a laptop reboot.

Alycat

Any progress?
(1) The USB component does not work with FastMM, demo program sent.
(2) If the USB device has been on for a while, with presumably lots of records waiting to be read, only 10 or 20 records get read, and the computer needs to be rebooted - demo program sent.
(3) If our setup routine is called twice, USB stops working, demo program sent.

Roman Novgorodov

Hello

We are trying to reproduce problem with our hardware on our side. While we ca not reproduce your situation.

Please try to run DBGVIEW utility, switch on its Kernel mode and repeat problem with your program.

Possible DBGVIEW will show more info from kernel driver. Give me its LOG file.

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

Alycat

All 3 problems? FastMM is not a problem when you run?

Roman Novgorodov

Hello

No. DBGView will show (possible) warning from kernel driver code.

XE2 has built-in FastMM and it does not reports about any leaks or other problems. All our demos are compiled in XE2 and work good.

Also I recommend you to try latest version 9.25. It has some corrections in driver and usb calls.

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

Alycat

Quote from: Roman Novgorodov on November 02, 2011, 02:08:05 pmXE2 has built-in FastMM and it does not reports about any leaks or other problems. All our demos are compiled in XE2 and work good.
I think XE has a copy of FastMM built in, so did some earlier versions, BUT there never seems to be any leak messages  - do you ever get a leak message using the built in FastMM???

QuoteAlso I recommend you to try latest version 9.25. It has some corrections in driver and usb calls.
Where do I get that, I can't see any version numbers on your download page, nrComm.zip seems to date from September?