7-14
<7. I/O Communications >
IM 34M6H28-01E
1st Edition : Feb.01,1999-00
■
Example of BASIC Programming
10
! **********************************************************
20
! * F3LD01-ON SAMPLE PROGRAM
30
! * Start/Stop Operation and Status Management
40
! **********************************************************
50
! ****Initial setup****
60
DEFINT A-Z
70
DIM DLIST (3), DSTS (3)
80
LDSLOT = 4
90
ASSIGN LD01 = LDSLOT
100 !
110 !****Initialization Clear Error****
120 CONTROL LDSLOT, 102; $0001, $FFFF
: ! Request to Clear Error (Y
49)
on, and other relays off
130 CONTROL LDSLOT, 101; $0000, $FFFF
: ! Other relays off
140 STS=0
150 WHILE BIT (STS, 0) = 0
: ! Wait till Clear Error Confirmation
(X
17) is turned ON
160 STATUS LDSLOT, 102; STS
170 END WHILE
180 CONTROL LDSLOT, 102; $0000, $0001
: ! Request to clear Error (Y
49)
is off
190 !
200 ! ****Preparations for the operation****
210 ON TIMER #1,20000 GOTO ERROR@
: ! set 20 second timer
220 !
230 FOR I=0 TO 3
: ! Read scan list
240 ENTER LDSLOT, 21+I NOFORMAT;DLIST (I)
250 NEXT I
260 !
270 !
280 GOSUB DWRITE@
: ! Write output data
290 !
400 !****Start operation****
410 CONTROL LDSLOT,101; $0200,$0200
: ! Set scan operation mode (Y
42 ON)
420 CONTROL LDSLOT,101; $0100,$0100
: ! Request to start scanning (Y
41
ON)
430 !
440 LOOP1@
450
STS=0
460
STATUS LDSLOT,101;STS
: ! Wait till X
9 turns on
470
SCANON=BIT(STS,8)
480
IF SCANON<>1 THEN LOOP1@
490 FOR I=0 TO 3
:! Confirm the status information of
other nodes
Содержание FA-M3 Vitesse
Страница 2: ...Blank Page...
Страница 28: ...Blank Page...
Страница 40: ...Blank Page...
Страница 94: ...Blank Page...
Страница 116: ...Blank Page...
Страница 118: ...Blank Page...