3 rs-422-a/rs-485 sample programs, Output the setting data – Yokogawa DA100 User Manual

Page 88

Advertising
background image

IM DA100-11E

8-7

Sample Program

8

8.3

RS-422-A/RS-485 Sample Programs

This section describes sample program for a system using PC9801 series (NEC) with the RS-422-A/
RS-485 interface. We hope that these samples will aid you in creating your own program.

Configuration

Model

: NEC PC9801 series

Language

: N88-BASIC (Standard programming language on the PC9801 series)

Wiring system

: four-wire system (both four-wire and two-wire systems are introduced in this

manual for the ASCII output of the measured data).

Setting the RS-422-A/RS-485 Parameter

Baud rate

: 9600

Data length

: 8

Parity

: Even

Stop bit

: 1

Address

: 01

Setting the Personal Computer

Be careful when receiving BINARY data that the received data does not overrun the capacity of the
receive buffer in the personal computer which may be small as 255 bytes in some case.

Output the Setting Data

Read out the setting data from DA100, display them on CRT of the personal computer, and save
them to floppy disk.

10

20

OPEN “COM1:E81N” AS #1

30

OPEN “TS1.DAT” FOR OUTPUT AS #2

40

50

PRINT #1,CHR$(&H1B)+”O 01"

60

LINE INPUT #1,D$ :PRINT D$

70

PRINT #1,”TS1"

80

LINE INPUT #1,D$ :PRINT D$

90

PRINT #1,CHR$(&H1B)+”T”

100

LINE INPUT #1,D$ :PRINT D$

110

PRINT #1,”LF001,010"

120

LINE INPUT #1,D$

130

PRINT D$

140

PRINT #2,D$

150

IF LEFT$(D$,2)<>”EN” THEN GOTO 120

160

170

PRINT #1,CHR$(&H1B)+”C 01"

180

LINE INPUT #1,D$ :PRINT D$

190

CLOSE

200

END

Advertising