FieldTalk™ Modbus Master .NET Library

MbusSerialMasterProtocol.enableRs485Mode Method 

Enables RS485 mode

[Visual Basic]
Public Function enableRs485Mode( _
   ByVal rtsDelay As Integer _
) As Integer
[C#]
public int enableRs485Mode(
   int rtsDelay
);

Parameters

rtsDelay
Delay time in ms (Range as 0 - 100000) which applies after the transmit buffer is empty. 0 disables this mode.

Return Value

BusProtocolErrors.FTALK_SUCCESS on success or error code. See BusProtocolErrors for possible error codes.

Remarks

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.

Note    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.
Note    A protocol must be closed in order to configure it.

See Also

MbusSerialMasterProtocol Class | FieldTalk Namespace