老 姚
/
modbusServer2
modbus for modular2_dio10
Diff: modbus/modbus.cpp
- Revision:
- 1:8fcbafe2ca98
- Parent:
- 0:998a68b8defc
--- a/modbus/modbus.cpp Tue Sep 17 01:59:40 2019 +0000 +++ b/modbus/modbus.cpp Sat Sep 28 02:25:51 2019 +0000 @@ -177,8 +177,12 @@ resultCRC = calculateCRC16(rbuf,index); sbuf[index++]=(resultCRC>>8)&0xff; sbuf[index++]=resultCRC &0xff; + dir=1; + wait_ms(2); for (i=0;i<index;i++) rs485.putc(sbuf[i]) ; + wait_ms(2); + dir=0; return true; } unsigned int Modbus::calculateCRC16( uint8_t *puchMsg,unsigned int usDataLen)