このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
モデル化
ハードウェア接続用の Simulink® モデルを準備し、ハードウェア プロトコルをサポートするためのブロックを追加し、各種アプリケーションを取り上げた参考例を参照します。
ブロック
Analog Input | アナログ入力ピンの電圧を測定 |
Analog Output | Generate voltage on the specified analog output pin in volt (V) (R2023a 以降) |
Digital Read | デジタル入力ピンの論理状態を読み取り |
Digital Write | デジタル出力ピンの論理状態を設定 |
External Interrupt | Trigger 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 Write | UART に N 行 1 列の配列データを送信 |
SPI Controller Transfer | SPI 周辺デバイスに対するデータの書き込みとデータの読み取りを行う |
SPI Register Read | SPI 周辺デバイス レジスタからデータを読み取る |
SPI Register Write | SPI 周辺デバイスのレジスタにデータを書き込む |
Modbus RS485 Client Read | Client device reads data from server device register(s) over RS485 network (R2021b 以降) |
Modbus RS485 Client Write | Client device writes data to server device register(s) over RS485 network (R2021b 以降) |
Modbus RS485 Server Read | Server device reads data from the server device register over RS485 network (R2021b 以降) |
Modbus RS485 Server Write | Server device writes data to server device register over RS485 network (R2021b 以降) |
HTS221 Humidity Sensor | Measure relative humidity and temperature from HTS221 sensor (R2021b 以降) |
LIS3MDL Magnetometer Sensor | Measure magnetic field strength and temperature from LIS3MDL Magnetometer sensor (R2021b 以降) |
LPS22HB Pressure Sensor | Measure barometric air pressure and temperature from LPS22HB sensor (R2021b 以降) |
LSM6DSL IMU Sensor | Measure linear acceleration, angular rate, and temperature from LSM6DSL sensor (R2021b 以降) |
ADXL34x Sensor | Measure linear acceleration along axes of ADXL34x family of accelerometers (R2022a 以降) |
BMI160 IMU Sensor | Measure linear acceleration, angular rate, and temperature from BMI160 sensor (R2023a 以降) |
VL53L0X Time of Flight Sensor | Measure distance to a target object (R2023a 以降) |
LIS3DH Accelerometer Sensor | Measure linear acceleration, voltage, and temperature from LIS3DH sensor (R2023b 以降) |
CCS811 Air Quality Sensor | Measure equivalent CO2 (eCO2) and the equivalent total volatile organic compound concentration (eTVOC) (R2023b 以降) |
CAN Receive | Receive message from CAN network (R2021b 以降) |
CAN Transmit | Transmit message to CAN network (R2021b 以降) |
TCP/IP Receive | Receive data over TCP/IP network from remote host |
TCP/IP Send | Send data over TCP/IP network to remote host |
ThingSpeak Read | Read data stored in ThingSpeak channel (R2021b 以降) |
ThingSpeak Write | Publish data to Internet of Things using ThingSpeak (R2021b 以降) |
UDP Receive | Receive UDP packets from UDP host |
UDP Send | Send UDP packets to UDP host |
CAN Read | Read message from CAN network |
CAN Write | Write message to CAN network |
TCP/IP Receive | Receive data over TCP/IP network from remote host |
TCP/IP Send | Send data over TCP/IP network to remote host |
ThingSpeak Read | Read data stored in ThingSpeak channel (R2021b 以降) |
ThingSpeak Write | Publish data to Internet of Things using ThingSpeak (R2021b 以降) |
UDP Receive | Receive UDP packets from UDP host |
UDP Send | Send UDP packets to UDP host |
Byte Pack | Convert input signals to 8-, 16-, or 32-bit vector |
Byte Unpack | Unpack 8-, 16-, or 32-bit input vector to multiple output vectors |
Byte Reversal | Reverse little-endian data for big-endian processor |
Memory Copy | Copy to and from memory section |
Protocol Encoder | Encode input data into a uint8 byte stream by specifying the packet structure (R2023a 以降) |
Protocol Decoder | Decode a uint8 byte stream by specifying the packet structure (R2023a 以降) |
トピック
- Signal Monitoring and Parameter Tuning over XCP on Serial and TCP/IP
Use your host computer to monitor and control an application running on the target hardware.
- Communicate with Hardware Using Connected IO
Get peripheral data from the hardware before deploying the Simulink model on the hardware.
- Usage of Alternate Pin Names
Accessing multiple hardware peripherals connected to the same pin using alternate pin names.
トラブルシューティング
Workaround for Interrupt Workflow with Sensors
This topic helps you with the workaround for interrupt workflow in sensors.
注目の例
Getting Started with Simulink Coder Support Package Using STMicroelectronics Nucleo Boards
Demonstrates how to use the Simulink® Coder™ Support Package for STMicroelectronics® Nucleo Boards to run a Simulink® model on an STMicroelectronics Nucleo board.
Read Data from I2C-Based Sensors Using STMicroelectronics Nucleo Boards
Use the Simulink® Coder™ Support Package for configuring and reading data from an I2C-based sensor using an STMicroelectronics® Nucleo board.
Communicating with an SPI Based EEPROM Using the STMicroelectronics Nucleo Board
Use Simulink® Coder™ Support Package for STMicroelectronics® Nucleo Boards to enable and write to/ read from an SPI based EEPROM.
Change the LED Glow Intensity on STMicroelectronics Nucleo Boards
Demonstrates how to use the Simulink® Coder™ Support Package to run a Simulink model on an STMicroelectronics® Nucleo board to brighten and dim an LED.
Read Accelerometer and Gyrometer Data from an STMicroelectronics Nucleo Board Using SCI Blocks
Use Simulink® Coder™ Support Package to send data to your computer from a STMicroelectronics® Nucleo board and read it using serial (SCI) blocks.
MODBUS RS485 Communication Between Client and Server Devices Using STMicroelectronics Nucleo Boards
Use the Simulink® Coder™ Support Package for STMicroelectronics® Nucleo Boards to implement a MODBUS® RS485 asynchronous, serial communication between MODBUS client and server devices. It also shows the four modes of operation: Client Read, Client Write, Server Read, and Server Write.
Trigger Downstream Function-Call Subsystem Using STMicroelectronics Nucleo External Interrupt Block with Data Ready Event on BMI160 Sensor
Use the Simulink® Coder™ Support Package for STMicroelectronics® Nucleo Boards to trigger a downstream function-call in Monitor and Tune action when a Data ready event occurs on BMI160 sensor using a ST Nucleo External Interrupt block. This example model for monitor and tune simulation, shows the capabilities of the External Interrupt block during data ready event on BMI160 sensor.
Identify Punch and Flex Hand Gestures Using Machine Learning Algorithm on STMicroelectronics Nucleo Boards
Use the Simulink® Coder Support Package for STMicroelectronics® Nucleo boards to identify punch and flex hand gestures using a machine learning algorithm. The example is deployed on an STM Nucleo board that uses an external sensor (LSM6DSL) available in sensor shield (X-NUCLEO-IKS01A2) to identify the hand gestures. The output from the machine learning algorithm, after identifying whether a hand gesture is a punch or a flex, is transmitted to the serial port where 0 represents a punch and 1 represents a flex.
Control Rotary Encoder Knob Using STMicroelectronics Nucleo Board
Use the Simulink® Coder™ Support Package for STMicroelectronics® Nucleo Boards to control a 12-step rotary encoder with a built-in push button.
ECG Signal Processing Using STMicroelectronics Nucleo Board
Use the STM32 Nucleo F767ZI board to process an ECG signal input from an ECG sensor, extract the heart rate in beats per minutes (bpm), and send the ECG signal and heart rate to the ThingSpeak™ internet of things (IoT) analytics platform service.
Single Click and Double Click Detection Using LIS3DH Single Click Interrupt
Use the Simulink® Coder™ Support Package for STMicroelectronics® Nucleo Boards to sense the free-fall of the sensor using the Single Click interrupt of LIS3DH linear accelerometer connected to a STMicroelectronics Nucleo board.
Free-Fall Detection Using LIS3DH Freefall Application Interrupt
Use the Simulink® Coder™ Support Package for STMicroelectronics® Nucleo Boards to sense the free-fall of the sensor using the Inertial freefall application interrupt of LIS3DH linear accelerometer connected to a STMicroelectronics Nucleo board.
Impact Detection Using LIS3DH Inertial Wakeup Interrupt
Use the Simulink® Coder™ Support Package for STMicroelectronics® Nucleo Boards to sense the impact of the sensor using the Inertial wake-up interrupt of LIS3DH linear accelerometer connected to a STMicroelectronics Nucleo board.
Triple-Axis Tilt Calculation Using LIS3DH FIFO Data Ready Interrupt
Use the FIFO data ready interrupt of LIS3DH linear accelerometer connected to a STMicroelectronics® Nucleo board to sense the tilt of the sensor. This is done using a downstream function-call subsystem that reads acceleration values from FIFO buffer sensor.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)