coassoftwaresystems / delphi-modbus

Delphi ModbusTCP components
MIT License
116 stars 64 forks source link

Application crash #35

Open calou3324 opened 5 years ago

calou3324 commented 5 years ago

Hello, My application use the ReadHoldingRegisters function and one time per day, it crashes in this function procedure TIdModBusClient.DoResponseMismatch(const RequestFunctionCode: Byte; const ResponseFunctionCode: Byte; const ResponseBuffer: TModBusResponseBuffer); begin if Assigned(FOnResponseMismatch) then FOnResponseMismatch(RequestFunctionCode, ResponseFunctionCode, ResponseBuffer); end;

and it comes from if ((AModBusFunction or $80) = ReceiveBuffer.FunctionCode) then DoResponseError(AModBusFunction, ReceiveBuffer.MBPData[0], ReceiveBuffer) else DoResponseMismatch(AModBusFunction, ReceiveBuffer.FunctionCode, ReceiveBuffer); Result := False;

How could i do solve it? I use v 1.7.0 and delphi 10.2

Thanks