
Originally Posted by
jmgelba
Are the values in BufferOut(1) through BufferOut(5) decimal? Are they bytes or words?
How do I receive these values and put them into VAR BYTES?
Do I always need to send the 8 values of BufferOut or can I send say just BufferOut(3)?
Can I send BufferOut(1) = "text here" for example?
Thank you!!
Hi, you are not reading the code that i posted.
If you read the code carfully you see that in VB the BufferOut Array is declared asbyte, so you can only send bytes.
Code:
Dim BufferOut(BufferOutSize) AsByte
On the PIC side you receive the bytes on the USBRXBuffer array, and then you do what you want with those bytes.
Code:
ARRAYREAD USBRXBuffer,[PORTB, DUTY1.LowByte, DUTY1.HighByte, DUTY2.LowByte, DUTY2.HighByte]
On the VB side you receive tte bytes on BufferIn array, and then you do what you want with thise bytes.
Code:
Dim BufferIn(BufferInSize) AsByte
Since the Define of the USB_INSIZE and USB_OUTSIZE are equal to 8, you can only send and receive 8 bytes. You can change this, to multiples values, like 16, 32, 64. YOu need always to send all th ebytes that are defined. You you Define 8, you must send 8 bytes, if you define 16 you must send 16 bytes. For instance, if you have only 10 bytes to send, you must define you USB_sizes equal to 16, and complete the array with 0's.
Can I send BufferOut(1) = "text here" for example?
You cannot do that, because it excedes the number of bytes. BufferOut(1) is one byte only. You cand o just this, BufferOut(1)="t", or
BufferOut = "0abcdefgh".
I think that you should read both PIC and VB code that i posted and review review some principles of the PBP manual.
Bookmarks