Remote Processing Coorporation RPC-320 Specifiche Pagina 38

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 186
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 37
Commands - 8
BIN$
String Function
SYNTAX: n$ = BIN$(m)
PURPOSE: Returns an 8–bit binary representation of a number.
REMARKS: The most significant bit (bit 7) is on the left and the least significant is on the right. If a string
argument is inadvertently used, the result will be zero.
This function is primarily used with the INP function to display the status of each input line.
RELATED: The HEX$ function and the “@” binary prefix.
EXAMPLE: PRINT BIN$(199)
11000111
This example illustrates the usefulness of BIN$ to determine the status of an I/O port. Suppose that
the port is connected to switches. Reading the value with the INP function yields 199. Without doing
calculations, it is difficult to tell which switches are on. Using BIN$ you can see immediately that
switches 0, 1, 2, 6 and 7 are on.
ERROR: <Type mismatch> – if m is a string or n is not a string.
<Data > 255> – for m.
<Data negative > – for m.
Vedere la pagina 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 185 186

Commenti su questo manuale

Nessun commento