Download External Interfaces/API
Transcript
Using Control Pins
1. Create the serial port objects – After the modems are powered on, the serial
port object s1 is created for the first modem, and the serial port object s2 is
created for the second modem.
s1 = serial('COM1');
s2 = serial('COM2');
2. Connect to the devices – s1 and s2 are connected to the modems. Since the
default value for the ReadAsyncMode property is continuous, data is
asynchronously returned to the input buffers as soon as it is available from the
modems.
fopen(s1)
fopen(s2)
Since the default value of the DataTerminalReady property is on, the computer
(data terminal) is now ready to exchange data with the modems. You can verify
that the modems (data sets) are ready to communicate with the computer by
examining the value of the Data Set Ready pin using the PinStatus property.
s1.Pinstatus
ans =
CarrierDetect:
ClearToSend:
DataSetReady:
RingIndicator:
'off'
'on'
'on'
'off'
The value of the DataSetReady field is on since both modems were powered on
before they were connected to the objects.
3. Configure properties – Both modems are configured for a baud rate of 2400
bits per second and a carriage return (CR) terminator.
s1.BaudRate =
s1.Terminator
s2.BaudRate =
s2.Terminator
2400;
= 'CR';
2400;
= 'CR';
4. Write and read data – Write the atd command to the first modem. This
command puts the modem “off the hook,” which is equivalent to manually
lifting a phone receiver.
fprintf(s1,'atd')
8-57
Related documents
MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER User`s manual
7 - Parent Directory
External Interfaces
Release Notes for Release 12
3 - McMaster Physics and Astronomy
Instrument Control Toolbox User`s Guide
Simulink Interface
GE SMARTHOME 45227-1 User's Manual
MATLAB Compiler
Link to the user and technical guide
ME964 GIT, Trac, CMake & CUDA Debugging
Mastering-PowerShell