主要内容

Modem Status

Return state of modem control lines

  • Modem Status block

Libraries:
Simulink Real-Time / RS232 / Mainboard

Description

The Modem Status block reads the state of the input modem control lines on the Speedgoat® target computer.

This block has outputs of type Boolean. If the input voltage is positive, the output is true. If the input voltage is negative, the output is false.

Examples

Ports

Output

expand all

If true, the modem is ready to receive data.

Dependency

To make this output visible, select the CTS parameter.

If true, the modem is ready to send and receive data.

Dependency

To make this output visible, select the DSR parameter.

If true, the modem is receiving a carrier from a remote device.

Dependency

To make this output visible, select the DCD parameter.

Parameters

expand all

Select this check box to monitor the CTS line of the modem.

Selecting this parameter makes the CTS port visible.

Programmatic Use

Block Parameter: cts

Select this check box to monitor the DSR line of the modem.

Selecting this parameter makes the DSR port visible.

Programmatic Use

Block Parameter: dsr

Select this check box to monitor the DCD line of the modem.

Selecting this parameter makes the DCD port visible.

Programmatic Use

Block Parameter: dcd

Enter the base sample time or a multiple of the base sample time. -1 means that sample time is inherited.

Programmatic Use

Block Parameter: sampletime

Specify the serial port type for communications. Choose Legacy Serial Port or USB Serial Port to specify the type of port used. Or, choose Specify to manually specify the path of the port used. For more information about serial ports, see RS-232 Serial Communication.

Dependencies

Setting Serial port type to Legacy Serial Port or USB Serial Port displays the Serial port number parameter in which you can specify the port number.

Setting Serial port type to Specify displays the Serial port parameter in which you can specify the port path.

Programmatic Use

Block Parameter: portType

Specify the serial port number for communications.

If using USB-to-serial adapters, the target computer detects these adapters as ttySUSB0, ttySUSB1, and so on in the order that the adapters are connected to the serial devices.

The order of port assignment is retained through the power cycle of the target computer or serial device if there is no change in the connections to the ports.

Dependencies

This parameter is visible if Serial port type is set to Legacy Serial Port or USB Serial Port.

Programmatic Use

Block Parameter: portNum

Specify the serial port device path for communications. The path can be the device path of a Legacy Serial Port or USB Serial Port.

Dependencies

This parameter is visible if Serial port type is set to Specify.

Programmatic Use

Block Parameter: nodePath

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2020b