Hi chenli@lincontrol.com,
You can find examples for FCAN Send/Receive Blocking mode in the <MBDT_ROOT>/MPC_Examples/mpc574x/fcan folder:
- flexcan_echo_blocking_mpc574x, for MPC5744P.
- flexcan_echo_blocking_mpc574xg.mdl, for MPC5748G.
- flexcan_echo_blocking_mpc574xr.mdl, for MPC5746R.
and in <MBDT_ROOT>/MPC_Examples/mpc577x/fcan folder:
- flexcan_echo_mpc5777c.mdl, for MPC5777C.
The <MBDT_ROOT> is the folder where the toolbox is installed. To find it, you can run mbd_find_mpc_root() command in Matlab console or navigate to it from the Add-On Manager window.
The outputs of the blocking FCAN_Receive block are:
- Status (enum)
- ID (uint8)
- Data (uint8(8))
- Length (uint8)
- Timestamp (uint16)
The Status and ID output labels from the FCAN_Receive block are hidden under the NXP logo. Resize the block and make it bigger to see all output labels.
The output of the blocking FCAN_Send is:
Status enum output is a Simulink enumeration mapped to the status_t C enum from SDK. Supported values for FCAN are:
- status_t.STATUS_SUCCESS if successful
- status_t.STATUS_TIMEOUT if the timeout is reached
- status_t.STATUS_BUSY if another receive/send using the same message buffer is in progress
To see the values of the status_t enumeration, type in Matlab console status_t. and press the TAB key.
Check the example models to see how to use the status output.
Thank you for reporting this issue. I will update the help page in a future release or cumulative patch.
Regards,
Paul