Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
read hex in matlab

Subject: read hex in matlab

From: Rami

Date: 24 Mar, 2008 16:27:46

Message: 1 of 2

Hello all,
Am trying to read hex values from a serial device that sends data (11 bytes) in continous mode.
As the following for example:
0E0039004584707CB101AD0E0038004284767CB301B10E00370042847D7CB501B90E0037004084817CB701BD0E0038004084817CB901C00E008004084837CBB01C4

0E is the starting character and then counts 11 characters and so on.
I am having trouble reading the values in matlab please does any one know a good way to a capture the data in a good way.
All am getting is garbage using common functions since when i convert back to hex i dont get the right value.
Thanks in advance

Subject: read hex in matlab

From: Randy Poe

Date: 24 Mar, 2008 16:39:44

Message: 2 of 2

On Mar 24, 12:27 pm, Rami <rdabo...@oakland.edu> wrote:
> Hello all,
> Am trying to read hex values from a serial device that sends data (11 bytes) in continous mode.
> As the following for example:
> 0E0039004584707CB101AD0E0038004284767CB301B10E00370042847D7CB501B90E0037004084817CB701BD0E0038004084817CB901C00E008004084837CBB01C4
>
> 0E is the starting character and then counts 11 characters and so on.
> I am having trouble reading the values in matlab please does any one know a good way to a capture the data in a good way.
> All am getting is garbage using common functions since when i convert back to hex i dont get the right value.
> Thanks in advance

I don't understand your description of the format. Do you
mean that the data is in groups of 11 bytes, and the first
byte is always 0E? How are the other 10 bytes supposed
to be interpreted?

Here's your first group for instance:

0E 00 39 00 45 84 70 7C B1 01 AD

what are you trying to do with these? And how are you
even sure you're reading the raw data correctly before
trying to interpret it?

               - Randy

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us