MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manual de usuario Pagina 351

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 408
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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 pagina 350
1 2 ... 346 347 348 349 350 351 352 353 354 355 356 ... 407 408

Comentarios a estos manuales

Sin comentarios