J
Dear listers:
I want to communicate between PLC and PC with Modbus Protocol. I use C++ and ReadFile and WriteFile functions to manage the serial port.
I am not sure NT is capable to manage modbus communication as a slave. The end frame detection needs for the PC to detect a blank of 3,5 characters. There is a structure CommTimeOut which permits to set timeouts when reading or writing. The first tests I have done show me the following
- the timeouts are set with 1 ms accuracy but I have to adjust them to 5 or 10ms instead of 3 or 4 ms (at 9600)
- when I write a frame,I don't know when I have to set the line low(with EscapeComm functions)
I use a sleep of 1ms after WriteFile function.
- the thread I use is in TimeCritical priority, but I can loose frames when if the CPU is utilized by another process.
Is it possible to write a reliable Modbus slave comunication with NT?
Are the readFile and writeFile functions sufficient, or do I need to write a driver with DDK?
Thank you
J-F Portala
SoViLor company
I want to communicate between PLC and PC with Modbus Protocol. I use C++ and ReadFile and WriteFile functions to manage the serial port.
I am not sure NT is capable to manage modbus communication as a slave. The end frame detection needs for the PC to detect a blank of 3,5 characters. There is a structure CommTimeOut which permits to set timeouts when reading or writing. The first tests I have done show me the following
- the timeouts are set with 1 ms accuracy but I have to adjust them to 5 or 10ms instead of 3 or 4 ms (at 9600)
- when I write a frame,I don't know when I have to set the line low(with EscapeComm functions)
I use a sleep of 1ms after WriteFile function.
- the thread I use is in TimeCritical priority, but I can loose frames when if the CPU is utilized by another process.
Is it possible to write a reliable Modbus slave comunication with NT?
Are the readFile and writeFile functions sufficient, or do I need to write a driver with DDK?
Thank you
J-F Portala
SoViLor company