News:

Welcome on our forum!

Main Menu

parse hex data

Started by HHC, April 28, 2020, 07:37:46 PM

Previous topic - Next topic

HHC

There is a hex data stream such as "E0 00 2C 01 E3 00 40 01" from serial port.  Two bytes is for one data point, and after processing, it should be read as "00E0", "012C", "00E3", and "01 40".

Can data logger suite do this?

Arthur Grasin

Hello,

It is hard to extract data from this data packet because it does not have a beginning and ending signatures. Our logger can split data by a timeout but is not reliable.

Ok. If you split data packets by timeout.

1. Enabled the ASCII Data Parser plugin.
2. Configure it to split your database by a timeout.
3. Define three parser items with the "Fixed position" type and length of 2. Positions are 1, 3, 5.
4. Use the Expressions filter plugin and convert your parser items to a readable decimal value using a function like:
VALUE_DEC=WORDTOSTRBE(VALUE)

If you like my work, please take a few seconds and add feedback about our site or our software [here]

HHC

Thanks Arthur,

I tried per your method. Sorry i am new to Data Logger. i actually did not really understand how to do - your step 3 and 4.

But it did not work. My setting is in the attached PDF documents.

Could you please help to check where i did wrong?

Arthur Grasin

1. Set the "String" data type for all parser items.
2. Set a unique item name for all parser items.
3. For example, if you define the "VALUE_HEX_LOW" for the first item, an expression should lokk like:

VALUE_HEX_LOW_DEC=WORDTOSTRBE(VALUE_HEX_LOW)

4. Select the "Show parsed values" data view mode.

If you like my work, please take a few seconds and add feedback about our site or our software [here]

HHC

Thanks Arthur!
i made some changes to my data parse setting in the attached PDF.

It works for "2C 01" - get a "300" number, but i get "NULL" when i try E0 00.

Also my question, whey here WORDTOSTR(X) works, not the WORDTOSTRBE(X)?

and how i input for the contents inside (X)? VAL1,VAL2,VAL3 or VAL1+VAL2+VAL3?

Many thanks!

Arthur Grasin

1. You do not need VAL3 in the parser settings.
2. Please, do not use VAL1+VAL2 inside WORDTOSTR()

VAL1_DEC=WORDTOSTR(VAL1)
VAL2_DEC=WORDTOSTR(VAL2)
If you like my work, please take a few seconds and add feedback about our site or our software [here]

HHC

Thanks Arthur!
1. I did some changes again, still no luck for "E0 00". the setting and results are in the attached PDF. Could you please check my setting again?
2. Also, please advise me the purpose to set up VAL2 here. I had tried to delete the VAL2, no impact on the results.
3. WORDTOSTR(X) is to convert something in the (X) to decimal. Do we only need to put one variable inside the (), because the variable, say, VAL1, does have two bytes? if we need to put more than one variables, say T1 and T2, how should we do?

Thanks again!

Arthur Grasin

Could you please open a ticket at https://support.aggsoft.com/ ?
We'll schedule a remote support session and I'll help you with setup.
If you like my work, please take a few seconds and add feedback about our site or our software [here]