1

Sending Hex data to RS232 port

Greetings Community!

 

I am trying to send hex data to a RS232 port, but have not quite figured out how to do it. Sending ASCII works fine, but haven't figured out the trick for hex. The hex string I'm trying to send is 02 50 4F 46 03.

This is my latest attempt, but not working:

serial = CreateObject("roSerialPort", 0, 9600)
sermsg = CreateObject("roByteArray")
sermsg.FromHexString("02504F4603")
serial.SendLine(sermsg)

Thank you so much for your help!

1 comment

  • 0
    Avatar
    Brooks Whiteford

    Happy to report I was able to resolve this, this ended up working for me:

     

    s.power_off = CreateObject("roByteArray")'
    s.power_off.fromhexstring("02504F4E03")
Please sign in to leave a comment.