MT_CtrlRS485

■Description

Set the RS422 / 485 communication mode of the RAS port and the terminating resistance.

■Synopsis

int MT_CtrlRS485 (int fd, unsigned char ucCtrl)

■Argument

int fd
  Please specify handle acquired by MT_Open function.

unsigned char ucCtrl
    bit0 : RXD(Receiver)setting
        0 : Reception enable
        1 : Reception disable
    bit1 : TXD(Sender)setting
        0 : Transmission enable
        1 : Transmission disable
    bit2 : termination resistance setting
        0 : disable
        1 : enable
    bit3 : RS422/485 communication mode
        0 : EC mode
        1 : RTS mode

※The following communication mode can be set.
(Setting of terminating resistor of bit 2 (0x04) can be set independently of communication mode setting.)
  0x00 : fullduplex(RS485_FULLDUPLEX)
  0x08 : halfduplex_rtsRS485_HALFDUPLEX_RTS)
  0x02 : halfduplex_ec_read(write disable)(RS485_HALFDUPLEX_EC_READ)
  0x01 : halfduplex_ec_write(read disable)(RS485_HALFDUPLEX_EC_WRITE)

■RETURN VALUE

If the function succeeds, NO_ERROR is returned.
If the function fails, a code other than NO_ERROR is returned.
The other errors : Error code details

■Note

Only BX-220 Series, BX-830 Series are supported.



Function List