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

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 408
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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.
Vista de pagina 377
1 2 ... 373 374 375 376 377 378 379 380 381 382 383 ... 407 408

Comentarios a estos manuales

Sin comentarios