# cbRS485()

Sets the direction of RS-485 communications port buffers.

## Function Prototype

C/C++

int cbRS485(int BoardNum, int Transmit, int Receive)

Visual Basic

Function cbRS485(ByVal BoardNum&, ByVal Transmit&, ByVal Receive&) As Long

## Arguments

BoardNum

The number associated with the board when it was installed with InstaCal or created with cbCreateDaqDevice(). BoardNum may be 0 to 99.

Transmit

Set to ENABLED or DISABLED (CBENABLED or CBDISABLED in Visual Basic). The transmit RS-485 line driver is turned on. Data written to the RS-485 UART chip is transmitted to the cable connected to that port.

Receive

Set to ENABLED or DISABLED (CBENABLED or CBDISABLED in Visual Basic). The receive RS-485 buffer is turned on. Data present on the cable connected to the RS-485 port is received by the UART chip.

## Returns

- Error code or 0 if no errors

## Notes

- You can simultaneously enable or disable the transmit and receive buffers. If both are enabled, data written to the port is also received by the port.