COMPAX-M/S
- RS485
10
4.5.2 BASIC program without BCC
!
P196 = 0 in both devices
OPEN "com2; 9600,N,8,1" FOR RANDOM AS #1-----Initialization of interface as #1 (channel 1)
com2:
serial interface COM2
9600:
9600 baud transmission rate
N:
no parity bit
8:
8 bit word length
1:
1 stop bit
text$ = "1S1" ----------------------------------------------------device 1 is to be interrogated for status 1
GOSUB output --------------------------------------------------calls up subprogram "Output"
GOSUB read ----------------------------------------------------calls up subprogram "Read"
PRINT text$ -----------------------------------------------------outputs read value to screen
text$ = "5S1"-----------------------------------------------------device 5 is to be interrogated for status 1
GOSUB output --------------------------------------------------calls up subprogram "Output"
GOSUB read ----------------------------------------------------calls up subprogram "Read"
PRINT text$------------------------------------------------------outputs read value to screen
END----------------------------------------------------------------program end
output: -------------------------------------------------------------start of subprogram "Output"
PRINT #1, text$-------------------------------------------------text$ is output with concluding C
R
to #1
RETURN----------------------------------------------------------branch back to main program
read: ---------------------------------------------------------------start of subprogram "Read"
INPUT #1, text$-------------------------------------------------value is read from #1 to text$
a$ = INPUT$(2, 1)----------------------------------------------characters LF and ">" are read from #1
RETURN----------------------------------------------------------branch back to main program
Содержание Hauser COMPAX 25 S F1 Series
Страница 12: ...COMPAX M S RS485 12 ...