MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manuel d'utilisateur Page 351

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 408
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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
Vue de la page 350
1 2 ... 346 347 348 349 350 351 352 353 354 355 356 ... 407 408

Commentaires sur ces manuels

Pas de commentaire