- Posts: 13
- Thank you received: 0
- Forum
- CodeTyphon Studio
- CodeTyphon Studio Components and Libraries
- SCADA/HMI Development
- Bug found and fixed on ModbusTCP.pas
×
Components and Libraries for HMI/SCADA applications, discussions, problems and suggestions
Question Bug found and fixed on ModbusTCP.pas
- Marco Pinero
-
Topic Author
- Offline
- New Member
-
Less
More
3 years 7 months ago - 3 years 7 months ago #12745
by Marco Pinero
Bug found and fixed on ModbusTCP.pas was created by Marco Pinero
Hi all.
I got this bug at modbustcp.pas from pl_PascalScada:
At line 410 Codetyphon has this code:
I solved it doing this:
That's all!!!...
I got this bug at modbustcp.pas from pl_PascalScada:
At line 410 Codetyphon has this code:
// data are ok
for i:=0 to Len-1 do begin
if (10+i*20)<Length(pkg.BufferToRead) then
Values[i]:=(LongInt(pkg.BufferToRead[9+(i*2)]) shl 8) + LongInt(pkg.BufferToRead[10+i*2])
else
Values[i]:=0
end;
// data are ok
for i:=0 to Len-1 do begin
if (10+i*2)<Length(pkg.BufferToRead) then (*<---- it is not I*20 (it is jumping 20 bytes and that's not correct) it must be I*2) *)
Values[i]:=(LongInt(pkg.BufferToRead[9+(i*2)]) shl 8) + LongInt(pkg.BufferToRead[10+i*2])
else
Values[i]:=0
end;
That's all!!!...
Last edit: 3 years 7 months ago by Marco Pinero. Reason: Bad text indentation
Please Log in or Create an account to join the conversation.
- Fabio Luis Girardi
-
- Offline
- Junior Member
-
3 years 7 months ago #12746
by Fabio Luis Girardi
Replied by Fabio Luis Girardi on topic Bug found and fixed on ModbusTCP.pas
I already have fixed this in Pascalscada repository, some days ago.
Thanks by your feedback!
Thanks by your feedback!
Please Log in or Create an account to join the conversation.
Moderators: Curt