Results 1 to 3 of 3

Thread: Binary data via serial link

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Location
    Argentina
    Posts
    2

    Binary data via serial link

    I need to transmit a .jpg file via a serial link at 9600 bps
    i use this code to transmit it

    .....................
    While ((tamanio_buffer_transmisor <= 511) And (byteleido < tamaniofoto))

    byteleido = byteleido + 1
    Get #1, byteleido, FileData
    ByteArray(tamanio_buffer_transmisor) = FileData
    tamanio_buffer_transmisor = tamanio_buffer_transmisor + 1
    Wend

    texto_transmitir = ByteArray
    puertoserial.Output = texto_transmitir
    .....



    How can i do for .jpg files ?
    This work fine for text file , but when i try a jpg file i dont recieve all bytes , you know why ? i mean , i recieve the data and when i try to save it to a file , the resultant file miss some bytes from the original files . the InputMode on reciever are binary or text ?
    it is a reciever or transmisor problem ?




    Thank u in advance
    Julian

  2. #2
    jim mcnamara
    Guest
    Try opening he input file as binary:
    Code:
    open "myfile.jpg" for binary as #1
    Dim myByte as byte
    Do while not Eof(1)
         get#1,,myByte
         ' send the byte
    Loop

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2002
    Location
    Argentina
    Posts
    2
    I do have the .jpg file opened in binary format already ,
    and i sent it as a byte array

    how can i read in the reciever , binary data ?
    because a do


    ........
    If RXCommT.InBufferCount Then

    'saved to some strings variable
    CommBufferT$ = RXCommT.Input
    BufferT = BufferT + CommBufferT$

    'Procces it and save it to a .jpg binary file
    '..........

    end if
    .......


    but it is a transmiter or reciever problem ?
    Thanks u.
    Julian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width