Hi Lukasz,

I’m not seeing where you’re contradicting … I’m not saying that we should get 
rid of the datatype … I’m just saying for some PLC types it’s not needed and 
could be omitted.
And for ADS we need to resolve the address no matter what we do. We can either 
load the tables when connecting and then don’t have to do so later, or we 
resolve addresses whenever one is requested. We need to do that anyway or we 
don’t know where to read it from and how big it is.

However, we could also see it this way:
if the datatype is indicated by the “:” the array information is indicated by 
the “[“
So, I guess we could also argue to have it

$adrType:$path:$dataType{$config}
$adrType:$path:$dataType[$arrayInfo]{$config}
$adrType:$path[$arrayInfo]{$config}

However, I would prefer the other option:

$adrType:$path:$dataType{$config}
$adrType:$path[$arrayInfo]:$dataType{$config}
$adrType:$path[$arrayInfo]{$config}

And if you refer to an array variable like this:

$adrType:$path

You simply get the full array.

Chris

Von: Łukasz Dywicki <l...@code-house.org>
Datum: Mittwoch, 2. Oktober 2024 um 16:47
An: dev@plc4x.apache.org <dev@plc4x.apache.org>
Betreff: Re: [DISCUSS] Change the default structure of an address string?
Hello Chris,
I can contradict your point of view a bit. Strong relying on type
information might be a dead end, because we will never be able to cover
all cases specific hardware vendor have.
Some of ADS devices do not have symbol table (i.e. plain I/O islands),
therefore hard assumptions on type information can simply broke the ADS
driver. I believe that possibility to specify tag type should remain
possible. First to let driver avoid round trips, second make an option
to shift management of this to user program, if he is willing to take
that part.

All of our address can be aligned to either:
$adrType:$path:$dataType{$config}
$adrType:$path[$arrayInfo]:$dataType{$config}

Config is optional, currently not all drivers use it (the key-value
pairs), we have it in case of modbus and hopefully soon with opc-ua.

Best,
Łukasz

On 2.10.2024 16:14, Christofer Dutz wrote:
> Hi all,
>
> I have recently been working on fine-tuning some of our API parts related to 
> tag parsing, value validation etc.
> Next on my list is the correct handling of array types. I think in most of 
> our drivers we have paid only little attention to these in the past.
>
> Now for most protocols, we need to define the type in the address string, as 
> there’s no way to know how to interpret the type.
> That’s why we currently have this convention:
> "{some-address}:{data-type}[{array-information}]"
>
> However, there are some where this information is provided by the protocol … 
> such as ADS and most probably Logix etc. The more drivers we create with 
> browse support, the more this will be.
>
> In that case we shouldn’t let the users provide the datatype and simply use 
> the one coming from the PLC as that’s more probably going to be right.
>
> Now if we omit the datatype from these addresses, then we would sort of break 
> our usual convention.
>
> I would therefore propose to change the order to this:
> "{some-address}[{array-information}]:{data-type}"
>
> What do you think?
>
> As always … If I don’t hear anything otherwise for the next few days I’ll 
> simply change it.
>
> Chris
>

Reply via email to