}

19Set COM1 port as RS485 or modem

This function call is used to set COM1 port as RS485 serial port or modem when you have the internal modem interface installed. Before you can start to use modem for communication, you must set COM1 port as modem.

Entry Parameters:

AH = 19

 

 

AL = 0

; set as RS485

 

1

; set as modem

Returned Value:

None

 

void TC_modem_port(int status)

{

regs.h.ah= 0x19; regs.h.al= status; int86(0x21,®s,®s);

}

3.3.Host Port for Multi-point Protocol I/O (INT21H)

1C Setup multi-point address

Entry Parameters:

AH = 0x1C

 

BH = 06

 

AL = 'A'..'Y','0'..'6'

Returned Values:

None

void TC_set_address(char status)

{

regs.h.ah= 0x1C; regs.h.al= status; regs.h.bh= 6; int86(0x21,®s,®s);

}

1C Set polling timeout duration

Entry Parameters:

AH = 0x1C

 

BH = 09

 

AL = 0-255

Returned Values:

None

void TC_time_out(int status)

;timeout period with base timeout cycle 80ms ;timeout period is 160ms when set AL=2; AL=0 for no timeout

3-24

Page 25
Image 25
Unitech MR350MKII manual Set COM1 port as RS485 or modem, Host Port for Multi-point Protocol I/O INT21H