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

  • 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 377
8 Serial Port I/O
8-58
Write the ata command to the second modem. This command puts the modem
in “answer mode,” which forces it to connect to the first modem.
fprintf(s2,'ata')
After the two modems negotiate their connection, you can verify the connection
status by examining the value of the Carrier Detect pin using the
PinStatus
property.
s1.PinStatus
ans =
CarrierDetect: 'on'
ClearToSend: 'on'
DataSetReady: 'on'
RingIndicator: 'off'
You can also verify the modem-modem connection by reading the descriptive
message returned by the second modem.
s2.BytesAvailable
ans =
25
out = fread(s2,25);
char(out)'
ans =
ata
CONNECT 2400/NONE
Now break the connection between the two modems by configuring the
DataTerminalReady property to off. You can verify that the modems are
disconnected by examining the Carrier Detect pin value.
s1.DataTerminalReady = 'off';
s1.PinStatus
ans =
CarrierDetect: 'off'
ClearToSend: 'on'
DataSetReady: 'on'
RingIndicator: 'off'
5. Disconnect and clean up – Disconnect the objects from the modems, and
remove the objects from memory and from the MATLAB workspace.
Vue de la page 377
1 2 ... 373 374 375 376 377 378 379 380 381 382 383 ... 407 408

Commentaires sur ces manuels

Pas de commentaire