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 desable)(RS485_HALFDUPLEX_EC_READ)
  0x01 : halfduplex_ec_write(read desable)(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-220D series, BX-830 series are supported.



Function List