Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in comunication with PLC #29

Open
flaviodei opened this issue May 31, 2018 · 1 comment
Open

Error in comunication with PLC #29

flaviodei opened this issue May 31, 2018 · 1 comment

Comments

@flaviodei
Copy link

Hello,
I'm trying to use the TIdModBusClient component with a plc management software that communicates via MODBUS, I encounter problems in sending commands, I always receive an exception of DoResponseMismatch.
By debugging at the component level in the TIdModBusClient.SendCommand function, I receive data from the server but in the code step
{$ IFDEF DMB_INDY10}
iSize: = IOHandler.InputBuffer.Size;
IOHandler.ReadBytes (RecBuffer, iSize);
Move (RecBuffer [0], ReceiveBuffer, iSize);
the value of AModBusFunction that initially contains the correct code is reset to zero.
I do not understand where I'm wrong ...
Thanks for your help.

@JensMertelmeyer
Copy link
Contributor

JensMertelmeyer commented Jun 1, 2018

Can't you record the network traffic to reproduce the issue? Or at least extract the raw bytes by using the debugger and post them here. If the ModbusFunction in the reply of your PLC is zero, then this is not a valid Modbus reply as the highest bit in the function code has to be set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants