Skip to Content
0
Former Member
Jul 04, 2014 at 10:38 AM

Write hex string to serial port directly from ABAP

526 Views

Hello everybody,

I have worked with the function module presented here: Read COMM port using ABAP w/o third party software

It is working fine, I am able to write to the serial port.

The only problem is that i need to send a hexadecimal string on the serial port, and the function module uses a property of MSCOMM ActiveX Control that sends only characters.

An example:

I want to send the following hex values on the serial port: 01 24 56. I created an XSTRING in ABAP and has the value 012456, which is ok, but the serial port receives the following hex values: 30 31 32 34 35 36, which are the converted ASCII values for the components of the string sent from ABAP.

I need to send hex strings (and not ASCII characters) because the communication protocol with the device I am using requires special hex characters (with values under 20H)

Is there a way to send hex strings to the serial port directly from ABAP without involving third-party software?

Thanks in advance,

Stefan