Rockwell-automation 1771-DB BASIC MODULE Manual de usuario Pagina 187

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 394
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 186
Chapter
Statements
1
1
11 -35
Use the ST@ statement to store BASIC module floating point numbers to a
specified address. The expression following the ST@ statement specifies
the address where you want the number stored in RAM. The ST@
statement takes the value on the top of the argument stack and stores it in
RAM at the address location you specify by expr.
You can use this statement with CALL 77 (page 13 -6) to store variables to
a protected area of memory. This protected area is not zeroed on power up
or when you issue the RUN command (page 10 -19). Use the LD@
statement (page 11 -18) to retrieve the floating point number you stored
with the ST@ statement.
Important: ST@ and LD@ are not used with any port designation.
Syntax
ST@
expr
Example
>
PRINT MTOP
24575
>
PRINT MTOP–10*6
24515
>
PUSH 24515 : CALL 77
>
PRINT MTOP
24515
>
1 REM EXAMPLE PROGRAM
>
5 DIM A(10),B(10)
>
10 REM *** ARRAY SAVE ***
>
20 FOR I = 0 TO 5
>
30 A(I) = I+20
>
40 PUSH A(I) : REM PUT NUMBER ON STACK
>
50 ST@ 5FFFH-I*6
>
60 NEXT I
>
70 REM *** GET ARRAY ***
>
80 FOR I = 0 TO 4
>
90 LD@ 5FFFH-I*6
>
100 POP B(I) : REM GET NUMBER FROM STACK
>
110 PRINT B(I)
>
120 NEXT I
READY
>
RUN
20
21
22
23
24
READY
>
PUSH 5FFFH : CALL 77
>
PRINT MTOP
24575
ST@
Vista de pagina 186
1 2 ... 182 183 184 185 186 187 188 189 190 191 192 ... 393 394

Comentarios a estos manuales

Sin comentarios