send the hex data

Discussion in 'Questions (Windows Mobile)' started by alex_up, Dec 15, 2007.

Thread Status:
Not open for further replies.
  1. alex_up

    alex_up Member

    Hi to All!
    How to send the Hex data over Serial ?

    Thank you.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can send data as a string or as an array of bytes.
    What type of data do you have? Can you give us a small example of it.
     
  3. alex_up

    alex_up Member

    Erel ,
    I need to send for example follow data:

    1. 7E 40 25 01 00 00 8E 03 09 40 7E
    2. 7E 40 25 00 00 00 8E 03 A3 11 7E

    here two commands


    Regards,
    Alex
     
    Last edited: Dec 16, 2007
  4. Erel

    Erel Administrator Staff Member Licensed User

    Where does this data come from?
     
  5. alex_up

    alex_up Member

    Erel , from simple host terminal (for win2k) for control servo drivers
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    I've modified the SerialTermial example to parse the data, convert it to a bytes array and send it.
    bit is a Bitwise object.
    The complete source code is attached.
    Code:
    Sub btnSend_Click
        strings() = StrSplit(textBox1.Text,
    " ")
        
    Dim data(ArrayLen(strings())) As byte
        
    For i = 0 To ArrayLen(strings())-1
            data(i) = 
    bit.HexToDec(strings(i))
        
    Next
        
    If serial.PortOpen = true Then serial.Output2(data())
    End Sub
     

    Attached Files:

    • a.sbp
      File size:
      3.1 KB
      Views:
      50
  7. alex_up

    alex_up Member



    Erel its great!!!
    Its work!
    Thank you very very match!!!
    Best regards,
    Alex.
     
  8. alex_up

    alex_up Member

    Erel ,can you create Text ini file for 20 commands ,with 20 buttons?
    Its very hard?

    I am sorry for my stupid questions but its necessary for me (i beginning user)

    Regards.
     
  9. Erel

    Erel Administrator Staff Member Licensed User

  10. alex_up

    alex_up Member

    Erel,
    Why compilled Device.exe not run on my PPC (Error loading programm .....\Serial2.dll)?
    It's work only under Basic4ppc ,from source code.

    Operation system WM2003SE, .NET CF 2.0 and Bitwise.dll,Serial2.dll installed.

    Regards.
     
  11. Erel

    Erel Administrator Staff Member Licensed User

Thread Status:
Not open for further replies.
Loading...