matlab/matlab-agentic-toolkit / skills-catalog/test-and-measurement/matlab-use-vehicle-network
matlab-use-vehicle-network
UnverifiedUse when setting up vehicle network communication in MATLAB using Vehicle Network Toolbox. Covers CAN/CAN FD (fully implemented), with architecture for J1939, XCP, and future protocols. Handles hardware discovery, channel creation, bus configuration, message exchange, signal encoding/decoding, and analysis across all supported vendors. (Vector, Kvaser, PEAK-System, NI, SocketCAN, MathWorks Virtual).
references/can/receive.md
View on GitHub# Receive
## receive
```matlab
msgs = receive(ch, numMsgs, OutputFormat="timetable");
msgs = receive(ch, numMsgs);
```
## Timetable Output (recommended)
```matlab
msgs = receive(ch, Inf, OutputFormat="timetable");
```
- Returns a timetable with columns: `Time`, `ID`, `Extended`, `Data`, `Length`, `Error`, `Remote`
- CAN FD timetables also include: `ProtocolMode`, `DLC`, `BRS`, `ESI`
- `Data` column is a cell array of `uint8` vectors
- `Inf` returns all available messages
- Returns empty timetable if nothing available (non-blocking)
## Object Output
```matlab
msgs = receive(ch, numMsgs);
```
- CAN Classic channels: returns array of message objects
- CAN FD channels: **always** returns a timetable regardless of `OutputFormat`
## Behavior
- Messages stored in FIFO buffer — oldest returned first
- Returns fewer messages if fewer are available than `numMsgs`
- Non-blocking — returns immediately with whatever is available
- Must poll in a loop; no callback/event-driven mode in script context
## Silent Mode — Receive-only, no bus impact
```matlab
ch.SilentMode = true; % set before start
start(ch);
```
- Channel observes bus traffic without participating (no ACK, no error frames)
- Useful for bus monitoring and diagnostic tools that must not affect bus state
- Must be set **before** `start(ch)`
- Default is `false` (normal active participation)
## Typical Patterns
**Poll for messages with timeout:**
```matlab
deadline = tic;
timeout = 2.0; % seconds
received = [];
while toc(deadline) < timeout
msgs = receive(ch, Inf, OutputFormat="timetable");
if ~isempty(msgs)
received = [received; msgs];
break;
end
pause(0.05);
end
```
**Passive bus monitor (no bus impact):**
```matlab
ch = canChannel('MathWorks', 'Virtual 1', 1);
ch.SilentMode = true;
configBusSpeed(ch, 500000);
start(ch);
pause(10);
msgs = receive(ch, Inf);
stop(ch);
```
----
Copyright 2026 The MathWorks, Inc.
----
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |