CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Still USB <-> Host (VB6) issue

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Jean FOUGERON



Joined: 30 Nov 2012
Posts: 110
Location: France

View user's profile Send private message Visit poster's website

Still USB <-> Host (VB6) issue
PostPosted: Tue Apr 09, 2013 2:57 am     Reply with quote

Hi friends
Does anybody know something on this subject?
I wrote my PIC application as follows:
Code:

if(usb_enumerated())
      {
         if(usb_kbhit(1))
         {
            usb_get_packet(1,in_data,USB_CONFIG_HID_RX_SIZE);
            
            Traitement();
            
            usb_put_packet(1,in_data,USB_CONFIG_HID_TX_SIZE,USB_DTS_DATA1);
         }   
      }


And tried 2 methods to exchange data with it in VB6.

Both connect themselves = OK

First is based upon usbhidio: (http://www.lvr.com/hidpage.htm#MyExampleCode) and it often takes Timeout seconds to answer (PIC receives data and send them back, but WaitForSingleObject function in VB takes a long time = 6s to read them).

Second one is based on mcHID.dll from http://www.mecanique.co.uk/ and seems easier to program, apart the fact that no data are sent from the Host by using the function hidWriteEx(VendorID, ProductID, OutputReportData(0)) (the PIC doesn't receive any data).

Have you an idea ?
Jean FOUGERON



Joined: 30 Nov 2012
Posts: 110
Location: France

View user's profile Send private message Visit poster's website

PostPosted: Thu Apr 11, 2013 3:34 am     Reply with quote

I succeeded to send data from the host, I'd to add a 0x00 on first byte !!!
Youpii !

But the delay is not solved
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Apr 11, 2013 5:13 am     Reply with quote

general comments...
What happens if you use a 'terminal program' like RealTerm? Is there any delay ?
I don't use VB, but have heard it's very 'top heavy'. Instead I've used Delphi and haven't seen any delays, especially 6 seconds...wow!
There is a lot of 'overhead' with using USB, perhaps other applications and programs are slowing down the PC ?

hth
jay
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group