You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@plc4x.apache.org by Christofer Dutz <ch...@c-ware.de> on 2023/02/18 22:39:33 UTC

[DISCUSS] Change the general tag-format to include "Encoding"?

Hi all,

As you know, I recently created a PR from the changes another github uses did based on our work. He also changed the syntax of the String tags in some drivers to include an encoding.

I didn’t like the format he chose (separating the encoding from the the rest with a pipe symbol). But in general I think it would be good, if we allowed specifying an encoding, if we want to use a non-default encoding.

So my proposal would be to add the encoding to all tags (not only strings) as I could also imagine that it might be beneficial to provide different types of integer, floating point, date and time encodings.

My proposal would be to have an additional encoding wrapped in curly braces at the end of the tag address:

Example:

%DB120.DBX234:STRING(10){ASCII}

Espeically for protocols like Modbus, I think this could be pretty good to have.

What do you think?

Chris



Re: [DISCUSS] Change the general tag-format to include "Encoding"?

Posted by Łukasz Dywicki <lu...@code-house.org>.
What do you think about making it two fold - one for making string 
encoding settable optionally for connection and separately at the tag level?

With regard to syntax, field/tag patterns themselves (AFAIK) so far do 
not use curly brackets anywhere, so its fine to begin with them.

Best,
Łukasz

On 18.02.2023 23:39, Christofer Dutz wrote:
> Hi all,
> 
> As you know, I recently created a PR from the changes another github uses did based on our work. He also changed the syntax of the String tags in some drivers to include an encoding.
> 
> I didn’t like the format he chose (separating the encoding from the the rest with a pipe symbol). But in general I think it would be good, if we allowed specifying an encoding, if we want to use a non-default encoding.
> 
> So my proposal would be to add the encoding to all tags (not only strings) as I could also imagine that it might be beneficial to provide different types of integer, floating point, date and time encodings.
> 
> My proposal would be to have an additional encoding wrapped in curly braces at the end of the tag address:
> 
> Example:
> 
> %DB120.DBX234:STRING(10){ASCII}
> 
> Espeically for protocols like Modbus, I think this could be pretty good to have.
> 
> What do you think?
> 
> Chris
> 
> 
> 

Re: [DISCUSS] Change the general tag-format to include "Encoding"?

Posted by Christofer Dutz <ch...@c-ware.de>.
Hi Otto,

I like that proposition … that’s really cool … probably would use “encoding” to avoid misinterpretations, but yeah … I like that.

And to Lukasz … I also thing this would be possible. But I’d consider both to be separate tasks … one to add the new syntax to the tags and to interpret them to override the default encoding for a tag and then one to override the default encoding for a type in the connection string.

Chris

From: Otto Fowler <ot...@gmail.com>
Date: Monday, 20. February 2023 at 18:36
To: dev@plc4x.apache.org <de...@plc4x.apache.org>
Subject: Re: [DISCUSS] Change the general tag-format to include "Encoding"?
I think if we are going to introduce a new symbols, then we name the
variable in the symbol, so that we can add multiple directives there and
not have to add another symbol every time

%DB120.DBX234:STRING(10){enc:ASCII}

unless you want to treat the {XXX} as {BIT_FLAGS}

So you can have {ENC_ASCII, FOO_BAR, VAS_DAS}





From: Christofer Dutz <ch...@c-ware.de>
<ch...@c-ware.de>
Reply: dev@plc4x.apache.org <de...@plc4x.apache.org> <de...@plc4x.apache.org>
Date: February 18, 2023 at 17:39:47
To: dev@plc4x.apache.org <de...@plc4x.apache.org> <de...@plc4x.apache.org>
Subject:  [DISCUSS] Change the general tag-format to include "Encoding"?

Hi all,

As you know, I recently created a PR from the changes another github uses
did based on our work. He also changed the syntax of the String tags in
some drivers to include an encoding.

I didn’t like the format he chose (separating the encoding from the the
rest with a pipe symbol). But in general I think it would be good, if we
allowed specifying an encoding, if we want to use a non-default encoding.

So my proposal would be to add the encoding to all tags (not only strings)
as I could also imagine that it might be beneficial to provide different
types of integer, floating point, date and time encodings.

My proposal would be to have an additional encoding wrapped in curly braces
at the end of the tag address:

Example:

%DB120.DBX234:STRING(10){ASCII}

Espeically for protocols like Modbus, I think this could be pretty good to
have.

What do you think?

Chris

Re: [DISCUSS] Change the general tag-format to include "Encoding"?

Posted by Otto Fowler <ot...@gmail.com>.
 I think if we are going to introduce a new symbols, then we name the
variable in the symbol, so that we can add multiple directives there and
not have to add another symbol every time

%DB120.DBX234:STRING(10){enc:ASCII}

unless you want to treat the {XXX} as {BIT_FLAGS}

So you can have {ENC_ASCII, FOO_BAR, VAS_DAS}





From: Christofer Dutz <ch...@c-ware.de>
<ch...@c-ware.de>
Reply: dev@plc4x.apache.org <de...@plc4x.apache.org> <de...@plc4x.apache.org>
Date: February 18, 2023 at 17:39:47
To: dev@plc4x.apache.org <de...@plc4x.apache.org> <de...@plc4x.apache.org>
Subject:  [DISCUSS] Change the general tag-format to include "Encoding"?

Hi all,

As you know, I recently created a PR from the changes another github uses
did based on our work. He also changed the syntax of the String tags in
some drivers to include an encoding.

I didn’t like the format he chose (separating the encoding from the the
rest with a pipe symbol). But in general I think it would be good, if we
allowed specifying an encoding, if we want to use a non-default encoding.

So my proposal would be to add the encoding to all tags (not only strings)
as I could also imagine that it might be beneficial to provide different
types of integer, floating point, date and time encodings.

My proposal would be to have an additional encoding wrapped in curly braces
at the end of the tag address:

Example:

%DB120.DBX234:STRING(10){ASCII}

Espeically for protocols like Modbus, I think this could be pretty good to
have.

What do you think?

Chris