4. Each Component Function
BX-2x0-DCxxxx, BX-2x0D-DCxxxx User’s manual
37
Controlling RS-485 communication
I/O ports use address 2a0/2a4h.
This section gives examples of flowcharts and programming related to switching enable signals for
transmission/reception.
Terminating resistor on/off settings are performed from the BIOS setup screen. Refer to Chapter 5, "BIOS
Setup", and adjust settings as necessary.
(1) Example flowchart
Open
:
Outputs command 87h to port 2a0h two times.
Output
:
Outputs command 93h to port 2a0h and then outputs settings data to port 2a0h.
Close
:
Outputs command aah to port 2a0h.
(2) Example programming
The following example is written in Intel 8086 assembly language.
The utility in IPC-SLIB-01 allows you to use this language in Windows.
(For the latest version of IPC-SLIB-01, visit the CONTEC website.)
;-------------------------------------------
;Open
;-------------------------------------------
CHK_OPEN1:
MOV
DX,2A4H
IN
AL,DX
TEST
AL,2
;Check status of output
JNZ
CHK_OPEN1
MOV
DX,2A0H
MOV
AL,87H
;Open Command
OUT
DX,AL
CHK_OPEN2:
MOV
DX,2A4H
IN
AL,DX
TEST
AL,2
;Check status of output
JNZ
CHK_OPEN2
MOV
DX,2A0H
MOV
AL,87H
;Open Command
OUT
DX,AL
CHK_OPEN3:
;Check status of input
MOV
DX,2A4H
IN
AL,DX
TEST
AL,1
JZ
CHK_OPEN3
MOV
DX,2A0H
IN
AL,DX
;Open success if AL = AAH
;-------------------------------------------
;Set TX/RX
Summary of Contents for bx200 SERIES
Page 1: ...IPC Series BOX PC for BX200 Series User s Manual CONTEC CO LTD ...
Page 7: ...vi BX 2x0 DCxxxx BX 2x0D DCxxxx User s manual ...
Page 19: ...2 System Reference 12 BX 2x0 DCxxxx BX 2x0D DCxxxx User s manual ...
Page 27: ...3 Hardware Setup 20 BX 2x0 DCxxxx BX 2x0D DCxxxx User s manual ...
Page 51: ...4 Each Component Function 44 BX 2x0 DCxxxx BX 2x0D DCxxxx User s manual ...
Page 91: ...5 BIOS Setup 84 BX 2x0 DCxxxx BX 2x0D DCxxxx User s manual ...
Page 113: ...6 Appendix 106 BX 2x0 DCxxxx BX 2x0D DCxxxx User s manual ...