MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manual do Utilizador Página 351

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 408
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 350
Writing and Reading Data
8-31
For example, since serial ports have separate read and write pins, you can
simultaneously read and write data. This is illustrated below.
Writing Data
This section describes writing data to your serial port device in three parts:
“The Output Buffer and Data Flow” describes the flow of data from MATLAB
to the device.
“Writing Text Data” describes how to write text data (string commands) to
the device.
“Writing Binary Data” describes how to write binary (numerical) data to the
device.
The functions associated with writing data are given below.
Table 8-5: Functions Associated with Writing Data
Function Name Description
fprintf
Write text to the device
fwrite Write binary data to the device
stopasync Stop asynchronous read and write operations
Serial Port I/O Hardware
s=serial('COM1');
fopen(s)
COM1
InstrumentMATLAB
Write
Read
Write
Read
Vista de página 350
1 2 ... 346 347 348 349 350 351 352 353 354 355 356 ... 407 408

Comentários a estes Manuais

Sem comentários