<Toc> <Ind>
<9. Configuration >
9-25
IM 34M6H28-01E
■
Sample BASIC Program
An example of a BASIC program is given here.
•
This module is installed in slot 4.
•
The contents to be registered in the scan list are set using a DATA statement.
•
-1 is set at the end of the data.
•
"END OK" is displayed on normal exit.
•
If an error occurs, "ERROR" and error code are displayed.
10
! ***********************************************
20
! * F3LD01-ON SAMPLE PROGRAM *
30
! * Scan list registration *
40
! ***********************************************
50
!
60
! ****Initialisation ****
70
DEFINT A-Z
80
DIM SDATA (17)
90
LDSLOT=4
100 ASSIGN LD01=LDSLOT
110 !
120 CONTROL LDSLOT, 102; $0000, $FFFF
: ! All output relays OFF
130 CONTROL LDSLOT, 101; $0000, $FFFF
140 GOSUB TBCLEAR@
: ! Clear Tool Command Buffer
150 !
160 !
200 ! ****Clear error****
210 CONTROL LDSLOT, 102; $0001, $FFFF
: ! Request to Clear Error (Y
49) ON
220 STS = 0
230 WHILE BIT (STS, 0) = 0
: ! Clear Error Confirmation (Wait for
X
17 ON)
240 STATUS LDSLOT, 102; STS
250 END WHILE
260 CONTROL LDSLOT, 102; $0000, $0001
: ! Reqest to Clear Error (Y
49) OFF
270 !
300 ! **** Set transmission time interval ****
310 MODE$="Set CycleTime"
320 NA = -1
330 GOSUB TBCLEAR@
: ! Clear Tool Command Buffer
340 OUTPUT LDSLOT, 400 NOFORMAT; $72
: ! Command $72
350 OUTPUT LDSLOT, 403 NOFORMAT; 20
: ! Set transmission time interval to 20ms
360 GOSUB COMMAND@
: ! Execute command
370 IF RES1<>$72 THEN GOTO ERROR@
: ! Proceed to error processing on error
380 !
400 ! ******** Delete Device ********
410 MODE$ = "Del Device"
420 STATUS LDSLOT, 101; STS
: ! Read output relay
1st Edition : Feb.01,1999-00
Содержание FA-M3 Vitesse
Страница 2: ...Blank Page...
Страница 28: ...Blank Page...
Страница 40: ...Blank Page...
Страница 94: ...Blank Page...
Страница 116: ...Blank Page...
Страница 118: ...Blank Page...