modbus timeout configuration for visual C


Thread Starter

J-F Portala

Hi listers,
I am trying to communicate with a PLC thanks to modbus protocol.

I am using visual C and the readfile and writefile functions.
My problem is that I have some difficulties to give the good value for the following parameters of the TimeOut structure

ReadIntervalTimeout ;
ReadTotalTimeoutMultiplier ;
ReadTotalTimeoutConstant ;
WriteTotalTimeoutMultiplier ;
WriteTotalTimeoutConstant ;

The parameter of my line are :
9600 bauds
no parity
8 bits data
1 stop bit

What are the rigth values I have to give?
Thank you for your help;
[email protected]
I'm assuming your trying to write the Modbus driver yourself. If so the following is the default settings of all Modicon controllers
shipped from the factory:

9600 bauds, even parity, 8 bits data, 1 stop bit

If the controller does not have a MB+ interface the PLC address will be 1. If the PLC has a MB+ interface the MB address will follow the MB+ dip switch settings. These settings are default and can be changed in the configuration software.

You might find it easier if you used the Modicon's OPC server. It is called OFS ( OPC Factory Server).