CAPL Script

General Functions

This reference collection includes Vector documentation reproduced with permission. Snippets may require configuration-specific symbols and are not all standalone programs. Sources and validation limits.

Select an API only after identifying the input, unit, execution context and failure result. Similar names do not imply compatible return codes or data lifetimes.

Start from the task

Task Workflow Decision to make before coding
Schedule a periodic action Timer exercise Milliseconds or seconds; relative rearming or an absolute schedule?
Limit command frequency 50 ms gate Accept the first command immediately; do rejected commands extend the gate?
Read numeric records from a file File I/O validation Path, handle, line endings, buffer limits and completeness evidence
Measure message intervals Timestamp workflow One stream, one unit and a continuous measurement segment
Investigate an unexpected result Two-source debugging case Which event and source produced the observed output?

A useful failure path is part of the design. For example, a numeric conversion returning zero may mean the input was zero or that conversion failed, depending on the API. A file read stopping does not by itself prove that every expected record was consumed. Preserve enough context to distinguish these outcomes.

Check the example's context

The API pages include authorized reference material, much of it recovered from CANoe 12 help. A fragment can depend on a configured environment variable, panel, logging block, database object or test-module context. Restore those prerequisites before copying a call. When the source version itself is ambiguous, the page should state that boundary instead of promising compatibility.

Keep local state lifetime separate from scope, and keep measurement time units separate from display formatting. The linked workflows add explicit decisions, counterexamples and acceptance procedures to the function reference.

Categories