How can I send a Hex-Code over Realterm without converting it?!

14 views (last 30 days)
Hello there,
I am using the newest Realterm Version (3.0.0.20 and Matlab R2014a) and try to send a Hexcode (for example '7e55443322117f') to my serial port. I have the problem that the Hex Data is always converted into ASCII code befor sending it.(Output is then the Ascii code 37 65 35 35 34 34 33 33 32 32 31 31 37 66) I guess that I need to "Send it as Numbers" (I have also found something like "SendAs" function but not how to implement it) from the Realterm program but I do not know how I can implement this function in Matlab.. Can someone help me with this?!
Thank you in advance!
Daniel
My mini-code example:
function [ ] = Realterm_send(send)
hrealterm=actxserver('realterm.realtermintf'); % start Realterm as a server
hrealterm.baud=57600;
hrealterm.caption='Matlab Realterm Server';
hrealterm.port='1';
hrealterm.windowstate=1; %minimized
hrealterm.PortOpen=1;
send = ('7e55443322117f');
invoke(hrealterm, 'PutString',send);
end

Accepted Answer

Daniel Niefi
Daniel Niefi on 4 Jun 2014
Hey Guys,
this was obvious: After searching for weeks I put the Question into a Forum and 40 minutes later I find the solution.
It is easy, you can change the Variant as the third point of the PutString code:
invoke(handle, 'PutString', send, 2);
Variant 2 is "Send as Numeric" and Variant 1 is standard ASCII.
Bye then!

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!