0
Under review

Basic Device - Serial Connection - Received Data structured in a better format

Calin Birtocean 1 year ago in Devices / Basic updated by ComfortClick Support 1 year ago 2

Hi,

I have a meter connected serial to bOS. I am looking to find a way to structure the received data so I can interpret it in bOS and display it. For example highlighted in yellow below the data 30 30 30 30 30 30 30 31 30 30 31 35 would be the meter number 10015. The 30 represents a 0, 31 represents a 1, 32 represents a 2, etc

Here is a part from the meter datasheet:

Image 4489


Here is the way the meter connection is configured in bOS as Basic Device:

Image 4490

 

Here is the command for the request string:

Image 4491

Same command with different data type:

Image 4492


Both the above commands return the same data:

Image 4497

Image 4496

As seen the command is sent and data is received. The challenge I have is that the value left in the string variable created doesn't contain the full string 

Image 4499

This would be the data displayed using their software:

Image 4500

Any tips on how this can be handled in bOS so when receiving the data it can be structured in such a way so when extracting the 30 30 30 30 30 30 30 31 30 30 31 35  it can be used as being the value for meter number 10015.

Thank you, 

Calin

Problem solved. The close string ends in 03 value before CRC

Image 4502

Image 4503

Image 4504

The question for @supportComfortClick: when using Regex, how can you call in bOS the groups created? such as Total_kWH? (?<=10015)(?<Total_kWh>[0-9]{8})(?<T1_kWh>[0-9]{8})

Currently it returns only the Match value of the Regex expression.


Thank you,

Calin

Under review

Hello Calin,

great to see you managed to resolve the issue! Currently bOS only returns the matched regex expression, we cannot call groups just yet. If there are many requests for this in the feature, it just might be added if possible.

Best regards.