Serial Receive
Read data from UART or USART port on PX4 flight controller
Add-On Required: This feature requires the UAV Toolbox Support Package for PX4 Autopilots add-on.
Libraries:
UAV Toolbox Support Package for PX4 Autopilots /
PX4 Utility Blocks
Description
The Serial Receive block reads data from the Universal Asynchronous Receiver Transmitter (UART) port or the Universal Synchronous and Asynchronous Receiver Transmitter (USART) port on the PX4® flight controller.
The block reads the values from the specified UART or USART port, and outputs the received values as a N-by-1 array. The properties for each port for serial communication are mentioned in the Configuration Parameters dialog box in Simulink® (go to Configuration Parameters > Hardware Implementation > /dev/tty* pane).
During the external mode simulation, the block outputs the results from the executable running on the target hardware.
During Normal mode simulation, the block outputs zeroes.
During Connected I/O simulation, this block reads data from the specified serial port of the hardware.
You can choose to read data in blocking or non-blocking mode. For more information, see Partially receive data from serial port and Receive data from serial port.
Note
If you are using Cube Orange autopilot, then use GPS2
for serial data
communication, as there might be issues using TELEM1
or
TELEM2
ports.
Examples
Ports
Output
Parameters
Version History
Introduced in R2018b