Welcome! Log In Create A New Profile

Advanced

[WD19] How to seperate and manage message from Serial Port

Posted by Mujahid 
[WD19] How to seperate and manage message from Serial Port
November 17, 2019 01:37PM
Hi All,

I got continuous string message from serial port like this:

Received:
54 65 6D 70 20 3A 20 32 39 2E 38 36 20 66 72 6F
6D 20 42 0
Got: Temp : 29.86 from A
RSSI: -39
Sent a reply

Received:
54 65 6D 70 20 3A 20 32 39 2E 39 35 20 66 72 6F
6D 20 42 0
Got: Temp : 29.95 from B
RSSI: -40
Sent a reply

Received:
54 65 6D 70 20 3A 20 32 39 2E 39 35 20 66 72 6F
6D 20 42 0
Got: Temp : 29.95 from C
RSSI: -40
Sent a reply



How do i separate this info and place it into table?

One color means, one complete set of data. It start with Received and finish with Sent a reply.

Anyone could share sample code?

Thanks a lot.

Regards,
Mujahid
Re: [WD19] How to seperate and manage message from Serial Port
November 18, 2019 02:26AM
Hi Jan de Bruin,

Thanks for the link.

Success by this code :

sMsg is string
sMsg = sRead(8,sInEntryQueue(8))

TableDeleteAll(TABLE_NoName1)

FOR EACH STRING ALibrary OF sMsg SEPARATED BY "Received:"
TableAddLine(TABLE_NoName1, ExtractString(ALibrary,2, CR)+ " " + ExtractString(ALibrary,3, CR),ExtractString(ALibrary, 4,CR),ExtractString(ALibrary, 5,CR))
END


Thanks a lot. smiling smiley

Regards,
Mujahid
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: