Quote Originally Posted by rocky79
Thanks Sean for the explanation, but there is still something i don't understand.
Question#1:
On the microcontroller side: How can i send the results of a 12 bits A2d Signal from the microcontroller to visual basic.net since USBBufferout is defined as a byte.
A byte is only 8 bits so you will have to store your result in a variable defined as a Word (16bits)
Now you will need to split the word and send the highbyte and lowbyte out as two bytes.
In your VB program you will then need to take the 2 bytes and joing them back as a word.

Quote Originally Posted by rocky79
Question#2
on the Visual basic.net side when your ready to send data back to the controller:
do you just include all the 64 bufferout bufferout(1) bufferout(2)....bufferout(63)
HidWriteEx, VendorId, ProductID, BufferOut(0), BufferOut(1)....BufferOut(63)
Or is there a shorter way to do it.
Re-read what I wrote above regards data being sent from VB. when you call HidWriteEx, VendorId, ProductID, BufferOut(0) you are telling the USB port to send all the data in the BufferOut.
So if you have defined your BufferOut as being 64 bytes long then when you call HidWriteEx it will send all 64 bytes, if you defined your BufferOut as being 8bytes long then it will send 8 bytes.

So simply load all the buffers up with the bytes you want and call HidWriteEx when you want to send.

Regards

Sean.