Click Dialect API
Tier: Dialect Surface
Click prebuilt blocks, aliases, and validation/communication helpers.
Mapping and Runtime Helpers
TagMap
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mappings
|
dict[Tag | Block, Tag | BlockRange] | Iterable[MappingEntry] | None
|
|
None
|
include_system
|
bool
|
Whether to include built-in system tag mappings
(SC/SD points). Default |
True
|
from_nickname_file
classmethod
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Path to the Click nickname CSV file. |
required |
mode
|
Literal['warn', 'strict']
|
Behavior for dotted UDT grouping failures:
|
'warn'
|
Returns:
| Type | Description |
|---|---|
TagMap
|
A |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the path does not exist. |
ValueError
|
If the CSV contains conflicting block boundaries or
mismatched memory types, or if |
to_nickname_file
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Path
|
Destination CSV path. Parent directories must exist. |
required |
Returns:
| Type | Description |
|---|---|
int
|
Number of rows written. |
validate
validate(
program: Program,
mode: ValidationMode = "warn",
profile: HardwareProfile | None = None,
) -> ClickValidationReport
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
program
|
Program
|
The Program to validate. |
required |
mode
|
ValidationMode
|
"warn" (findings as hints) or "strict" (findings as errors). |
'warn'
|
profile
|
HardwareProfile | None
|
Optional hardware capability profile override. |
None
|
Returns:
| Type | Description |
|---|---|
ClickValidationReport
|
ClickValidationReport with categorized findings. |
LadderBundle
dataclass
LadderExportError
Bases: RuntimeError
ClickDataProvider
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
runner
|
PLCRunner
|
The active |
required |
tag_map
|
TagMap
|
Mapping from logical tag names to Click hardware addresses. |
required |
fallback
|
DataProvider | None
|
Optional provider for unmapped addresses. Defaults to an in-memory provider. |
None
|
validate_click_program
validate_click_program(
program: Program,
tag_map: TagMap,
mode: ValidationMode = "warn",
profile: HardwareProfile | None = None,
) -> ClickValidationReport