4 years ago there was conversation about this. 
(https://lists.apache.org/thread/nh1fd2wv88p6hxpjm4v00t4py1rmxrog)

Back then XYZ[4] did mean read 4. I suppose reading byte 4 would be XYZ[4..4] 
with the old version? That seems odd to me.
I did not have the pleasure of dealing with this so I am not sure.

I like it better as you describe.

There was also a XYZ[3:4] • (4 Elements starting with index 3: 3, 4, 5 and 6).
Is it still valid? do we want to support it?


Nevertheless +1 by me to apply what you say to all drivers.

Unai


On Thursday, August 20th, 2026 at 3:51 PM, Christofer Dutz 
<[email protected]> wrote:

> Hi all,
> 
> As I’m currently going through things that I addressed in my fork, I came 
> across the fact that in my fork I treat:
> 
> %DB42:28.0:BYTE[4]
> 
> As reading one byte at index 4 … however I think some of our drivers 
> interpret is as „read an array of 4 bytes“.
> 
> I decided to go with the IEC standard of:
> 
> %DB42:28.0:BYTE[0..7]
> 
> Providing the start and end index of the elements I want.
> As some languages allow non-0 starts I define these as:
> 
> %DB42:28.0:BYTE[4..7]
> 
> If the offset is known by the driver.
> If the offset is not kown by the driver and it is not provided, then it 
> assumes the start is at 0
> However I can pass in the start index for cases where the driver doesn’t know 
> and it’s not 0
> 
> %DB42:28.0:BYTE[4..7;1]
> 
> And I should mention, that in case of non-0 arrays, this also helps:
> 
> %DB42:28.0:BYTE[4;1]
> 
> So … should we apply this to all drivers?
> 
> Chris
> 
>

Reply via email to