Documentation
FieldTalk Modbus Master Library for .NET
MbusSerialClientBaseenableRs485Mode Method |
Enables RS485 mode
Namespace: FieldTalk.Modbus.Master
Assembly: FieldTalk.Modbus.Master (in FieldTalk.Modbus.Master.dll) Version: 2.15.2-eval+3d8362b4bb861c05760d48b11d303e954bb8597c
Parameters
- rtsDelay
- Type: SystemInt32
Delay time in ms (Range as 0 - 100000) which applies after the transmit buffer is empty. 0 disables this mode.
Return Value
Type: Int32BusProtocolErrors.FTALK_SUCCESS on success or error code. See BusProtocolErrors for possible error codes.
In RS485 mode the RTS signal can be used to enable and disable the
transmitter of a RS232/RS485 converter. The RTS signal is asserted
before sending data. It is cleared after the transmit buffer has been
emptied and in addition the specified delay time has elapsed. The delay
time is necessary because even the transmit buffer is already empty,
the UART's FIFO will still contain unsent characters.
The use of RTS controlled RS232/RS485 converters should be avoided if possible. It is difficult to determine the exact time when to switch off the transmitter with non real-time operating systems like Windows and Linux. If it is switched off to early characters might still sit in the FIFO or the transmit register of the UART and these characters will be lost. Hence the slave will not recognize the message. On the other hand if it is switched off too late then the slave's message is corrupted and the master will not recognize the message.
| The delay value is indicative only and not guaranteed to be maintained. How precise it is followed depends on the operating system used, it's scheduling priority and it's system timer resolution. |
| A protocol must be closed in order to configure it. |