主要内容

建模

为硬件连接准备模型并添加模块以支持硬件协议

准备 Simulink® 模型以进行硬件连接,添加模块以支持硬件协议,并浏览各种应用情形的参考示例。

模块

全部展开

Analog Input测量模拟输入引脚的电压
Analog OutputGenerate voltage on the specified analog output pin in volt (V) (自 R2023a 起)
Digital Read读取数字输入引脚的逻辑状态
Digital Write设置数字输出引脚的逻辑状态
External InterruptTrigger the downstream function-call subsystem from an Interrupt Service Routine (自 R2021a 起)
I2C Controller Read从 I2C 外围设备或 I2C 外围设备寄存器读取数据
I2C Controller Write向 I2C 外围设备或 I2C 外围设备寄存器写入数据
PWM Output在指定输出引脚上生成方波
SCI Read在 UART 上读取 N×1 数据数组
SCI WriteN×1 数据数组发送到 UART
SPI Controller Transfer向 SPI 外围设备写入数据并从其读取数据
SPI Register Read从 SPI 外围设备寄存器读取数据
SPI Register Write向 SPI 外围设备寄存器写入数据
Modbus RS485 Client ReadClient device reads data from server device register(s) over RS485 network (自 R2021b 起)
Modbus RS485 Client WriteClient device writes data to server device register(s) over RS485 network (自 R2021b 起)
Modbus RS485 Server ReadServer device reads data from the server device register over RS485 network (自 R2021b 起)
Modbus RS485 Server WriteServer device writes data to server device register over RS485 network (自 R2021b 起)
HTS221 Humidity SensorMeasure relative humidity and temperature from HTS221 sensor (自 R2021b 起)
LIS3MDL Magnetometer SensorMeasure magnetic field strength and temperature from LIS3MDL Magnetometer sensor (自 R2021b 起)
LPS22HB Pressure SensorMeasure barometric air pressure and temperature from LPS22HB sensor (自 R2021b 起)
LSM6DSL IMU SensorMeasure linear acceleration, angular rate, and temperature from LSM6DSL sensor (自 R2021b 起)
ADXL34x SensorMeasure linear acceleration along axes of ADXL34x family of accelerometers (自 R2022a 起)
BMI160 IMU SensorMeasure linear acceleration, angular rate, and temperature from BMI160 sensor (自 R2023a 起)
VL53L0X Time of Flight SensorMeasure distance to a target object (自 R2023a 起)
LIS3DH Accelerometer SensorMeasure linear acceleration, voltage, and temperature from LIS3DH sensor (自 R2023b 起)
CCS811 Air Quality SensorMeasure equivalent CO2 (eCO2) and the equivalent total volatile organic compound concentration (eTVOC) (自 R2023b 起)
CAN ReceiveReceive message from CAN network (自 R2021b 起)
CAN TransmitTransmit message to CAN network (自 R2021b 起)
TCP/IP ReceiveReceive data over TCP/IP network from remote host
TCP/IP SendSend data over TCP/IP network to remote host
ThingSpeak ReadRead data stored in ThingSpeak channel (自 R2021b 起)
ThingSpeak WritePublish data to Internet of Things using ThingSpeak (自 R2021b 起)
UDP ReceiveReceive UDP packets from UDP host
UDP SendSend UDP packets to UDP host
CAN ReadRead message from CAN network
CAN WriteWrite message to CAN network
TCP/IP ReceiveReceive data over TCP/IP network from remote host
TCP/IP SendSend data over TCP/IP network to remote host
ThingSpeak ReadRead data stored in ThingSpeak channel (自 R2021b 起)
ThingSpeak WritePublish data to Internet of Things using ThingSpeak (自 R2021b 起)
UDP ReceiveReceive UDP packets from UDP host
UDP SendSend UDP packets to UDP host
Byte PackConvert input signals to 8-, 16-, or 32-bit vector
Byte UnpackUnpack 8-, 16-, or 32-bit input vector to multiple output vectors
Byte ReversalReverse little-endian data for big-endian processor
Memory CopyCopy to and from memory section
Protocol EncoderEncode input data into a uint8 byte stream by specifying the packet structure (自 R2023a 起)
Protocol DecoderDecode a uint8 byte stream by specifying the packet structure (自 R2023a 起)

主题

疑难解答

Workaround for Interrupt Workflow with Sensors

This topic helps you with the workaround for interrupt workflow in sensors.

精选示例