Denso RC5 Especificaciones Pagina 230

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 692
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 229
9-16
DEFIO (Statement) [Conforms to SLIM]
Function
Declares an I/O variable corresponding to the input/output port.
Format
DEFIO <Variable name> = <I/O variable type>,<Port address>[,<Mask data>]
Explanation
This statement declares a variable designated by <Variable name> as an I/O
variable.
<I/O variable type> Selects the type of the I/O variable. The I/O variable
types include BIT, BYTE, WORD and INTEGER. Designate a range of 1 bit for
a BIT type, 8 bits for a BYTE type, 16 bits for a WORD type and 32 bits for an
INTEGER type.
<Port address> Designates the starting input/output port number.
<Mask data> In the case of an input port, the AND (product set) from input
data and mask data is taken.
In the case of an output port, the AND (product set) from output
data and mask data is output, however, the output status of a
bit where no mask has been set does not change.
Related Terms
IN, OUT, SET, RESET
Example
DEFIO samp1 = BIT, 1
'Declares samp1 as a BIT type I/O variable which starts from
'port 1. The return value of samp1 becomes a 1-bit integer
'of 1 or 0 that expresses the status of port 1.
DEFIO samp2 = BYTE, 10, &B00010000
'Declares samp2 with mask data as a BYTE type I/O
'variable which starts from port 10. The return value of
'samp2 becomes an 8-bit integer of 0 or 16 that expresses
'the status of port 10.
DEFIO samp3 = WORD, 15
'Declares samp3 as a WORD type I/O variable which starts
'from port 15. The return value of samp3 becomes a 16-bit
'integer of 0&Hffff which expresses the status of the ports
'from15to30.
DEFIO samp4 = INTEGER, 1
'Declares samp4 as an INTEGER type I/O variable which
'starts from port 1. The return value of samp4 becomes a
'32-bit integer of 0&Hffffffff which expresses the
'status of the ports from 1 to 32.
Notes
For WORD and INTEGER, a port used as the MSB is assumed to be a sign bit.
The table below lists the allowable range of numeric values and pot
numbers used as the MSB.
WORD Allowable range of numeric values
MSB port No.: Starting port address + 15
INTEGER Allowable range of numeric values
MSB port No.: Starting port address + 31
Vista de pagina 229
1 2 ... 225 226 227 228 229 230 231 232 233 234 235 ... 691 692

Comentarios a estos manuales

Sin comentarios