Split serial message

Hello,

I am new to this forum and have my first question:

I have a serial port node that is receiving data.

The format of the recieived data is that each message STARTS with a 0xA5 and has that between 2 and 5 additional payload data.

I understood that I can split the received data within the serial input node, by entering the seperator charcater. But this is not what I need.

What I need are sequcenser likme this:

0xA5 0x0D 0x20 0x30
0xA5 0x06 0x56 0x63 0x10
0xA5 0x30

What this serial node is doing is:

0x0D 0x20 0x30 0xA5
0x06 0x56 0x63 0x10 0xA5

Any ideas how I can split my received data in that way I need it?

Thanks,

Sönke

Hi and welcome to the forum.

I just want to check what you are wanting to see/get.

So if you receive:

0xA5 0x0D 0x20 0x30

You want:

0x0D 0x20 0x30 0xA5

But that includes the 0xA5 from the next message.
Not a big deal, but just checking.

Hi, welcome to the forum

  1. Is this a known/documented protocol?
    2. If not, can you explain precisely what the start and end marks of a transmission are? (and any other gotchas for example, how do you escape the value 0xA5 when it is not a start mark but an actual data value?)
  2. Are you in control of what the serial device sends (i.e. would you be able to modify the serial device output if it made sense to?)

Hi,

I want the 0xA5 0x0D 0x20 0x30

That is what my devices sends out.
I have no END character that tells me the message is complete. I can only see this by receiving the new START character.

Ok, sorry. I looked at it the wrong way around.

So the device is sending:
0xA5 0x0D 0x20 0x30

and you want:

0x0D 0x20 0x30

Or is it 0x0D 0x20 0x30 0xA5?

I have no END character that tells me the message is complete

That isn't a problem unless you can get/receive 0xA5

You just keep looking at the received data UNTIL you get 0xA5

Hi, yes the protocl is know and documented. It is the output of a decibel meter of peak tec.

It has no END byte. That is my problem :wink:

I assume the 0xA5 can happen in the paypload. Due tot the fact that after the start byte 0xA5 an content identifier is sent that tells how many bytes will follow, that should be no problem (but perhaps for a spliiting alogrithm it can).

No, I can not change this protocol, it is the output of a closed device.

Thanks for your help.

Sönke

Hi,

no the device sends a 0xA5 as start indicator. Than a content indicator and than between 2 and 4 additional bytes.

Than it starts again with the 0xA5 and so on.

Assuming there is some sort of time gap between messages you may be able to use the timeout feature to detect the end of a message.

Can you post a link to the device protocol please?
[Edit] I see you have already posted the details, so ignore this.

So in the second part

0x06 is for time.

0x0D is for measurements

and anything else is a single piece....

Just checking.

1 Like

Hi. I am not allowed to post the pdf (am am a new user to this forum.) but you can see in the post above a screenshot of some information.

I can try to do that with the "timeout" bweteen the messages.

Is there not an online copy you can link to?

Would this sort of thing work for you?

I'll post pictures for now.

The flow

How the switch is configured

The output.

Thanks for the example.

I get the following error message:

msg : string[31]

"Encrypted credentials not found"

The serial output is binary and not strings. So the 0xA5 is a real number and not the characters 0xA5.

Any ideas for me?

Now I can post also pfds :wink:

8005_interface protocol.pdf (227.9 KB)

Can you not set the serial port to wait for the 0xA5 then send after a short timeout ? or is the stream continuous ?

I'm guessing it will be sporadic.

But the message wouldn't be sent until it is complete.

Though I guess increasing the time out wouldn't / shouldn't hurt.