coassoftwaresystems / delphi-modbus

Delphi ModbusTCP components
MIT License
119 stars 64 forks source link

Cannot read the Shark270 #56

Open JohnnyMarauder opened 2 years ago

JohnnyMarauder commented 2 years ago

Trying to read a Shark 270 Meter from Electro and it just reports Timed Out. Same code is able to read the Nexus1252 meters just fine. I set it up to read 40 registers to get the volts etc, but it just times out. Here is the calling code:

Shark200, Shark270 : Begin Try thereg := 1000; MM.mbClient.TimeOut := 500; If MM.mbClient.ReadHoldingRegisters(thereg, 40, MM.MyData) Then Begin float.fHi := MM.MyData[0]; float.fLo := MM.MyData[1]; MM.VoltsAN := float.fFloat; Volts_AN.Text := FloatToStr(MM.VoltsAN) + ' k'; End Else Memo1.Lines.Add('timeout reading response.'); Except On E : Exception Do Begin Raise TMetersException.Create('There was a problem reading the meter:'#13#10#13#10 + E.Message); End; End; End;

I setup Wireshark and can see the packet go out and one returns, but the read says nothing is received, I tested the same meter with two ohter modbus tools to see if they worked, and they did. Not sure what to do.