.
.
.
end else begin
Offset:=Address - FBufOffs;
If Offset + Size <= FBufLen then Result:=Pointer(Integer(FBuffer) + Offset);
.
.
.
by
..
end else begin
Offset:=Address - BufOffs;
If Offset + Size <= FBufLen then Result:=Pointer(Integer(FBuffer) + Offset);
.
.
.
Kinds Regards,
Philipe D'Hont.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The reason is that there was no detection of undefined parameters for BufOffs and BufLen in the Get...-methods.
In the next version of the component the default-values of these parameters will be -1 instead of 0, and each Get...-method will have this two lines at the beginning:
If BufOffs = -1 then BufOffs:=FBufOffs;
If BufLen = -1 then BufLen:=FBufLen;
Thanks for the Hint !
Best regards,
Axel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hy,
I'have a problem with Delphi and and TCP/IP connexion with a CPU 315-2 PN/DP.
Connexion is fine and working except when I try to ask data with a offset in the DB.
When I ask NoDave.ReadBytes(daveDB, 171, 0, 40);
Everything is ok, but when I specify an offset like this
NoDave.ReadBytes(daveDB, 171, 40, 40); // to read the 40 next byte.
Te function return back only errored value.
Any Idea welcome,
Kinds Regards,
Philippe D'Hont.
I found why I was getting errored value when an offset was specified.
For a temporary solution you can modify in the function :
function TNoDave.BufferAt(Address: Integer; Size: Integer; Buffer: Pointer; BufOffs: Integer; BufLen: Integer): Pointer;
You can change
.
.
.
end else begin
Offset:=Address - FBufOffs;
If Offset + Size <= FBufLen then Result:=Pointer(Integer(FBuffer) + Offset);
.
.
.
by
..
end else begin
Offset:=Address - BufOffs;
If Offset + Size <= FBufLen then Result:=Pointer(Integer(FBuffer) + Offset);
.
.
.
Kinds Regards,
Philipe D'Hont.
The reason is that there was no detection of undefined parameters for BufOffs and BufLen in the Get...-methods.
In the next version of the component the default-values of these parameters will be -1 instead of 0, and each Get...-method will have this two lines at the beginning:
If BufOffs = -1 then BufOffs:=FBufOffs;
If BufLen = -1 then BufLen:=FBufLen;
Thanks for the Hint !
Best regards,
Axel