LogMeTT.com • Transmitting a series of hex values or binary data over comm port.
Page 1 of 1

Transmitting a series of hex values or binary data over comm port.

Posted: Sat May 06, 2017 5:49 am
by yogeshk
I am aware that I could transmit a string via the "send" command, however I am not sure how do I transmit an equivalent of a binary buffer via COMM port.

so basically as an example I am trying to transmit the data buffer say an array of hex values [0x10, 0xFD, 0x0D] over the comm port. Every time I transmit just the decimal equivalent of those numbers it results in an invalid data received at the other end of the application listening on that comm port.

Here is a sample code

Code: Select all

  1.  
  2. # param2=20
  3. ; Opening Serial connection using COM port.
  4.  
  5. constr = '/C='
  6. strconcat constr param2
  7. strconcat constr ' /BAUD=115200'
  8.  
  9. connect constr
  10.  
  11. testlink
  12.  
  13. if result = 2 then
  14.     ; Assigning new title to TeraTerm window
  15.     settitle constr
  16.    
  17.     ; is this the right way to send binary/decimal data over the comm port?
  18.     send 16 253 13
  19. else
  20.     ; Assigning new title to TeraTerm window
  21.     settitle 'not connected'
  22. endif
  23.  


Thanks,
Yogesh

Re: Transmitting a series of hex values or binary data over comm port.

Posted: Sat May 06, 2017 6:13 am
by yogeshk
Figured that out, found an old forum article, to just switch the language to English and it worked.

Thanks,
Yogesh