dcs.hal.interface
Device parameter interface definitions for digital casting system.
This module defines data structures and interfaces for managing device parameters and variable definitions used in PLC communication. It provides standardized data classes for parameter metadata, variable mapping, and machine configuration.
DeviceStruct
dataclass
Data structure for defining device parameter information from JSON configuration.
This class represents a single parameter or variable definition used for communication between the control system and PLC. Each DeviceStruct contains metadata about the parameter including its identifier, variable names, data type, and activation status.
Attributes:
Name | Type | Description |
---|---|---|
id |
str
|
Unique identifier for the parameter within the device. |
var_name |
str
|
Local variable name used in the control system. |
var_name_IN |
str
|
PLC variable name used for actual communication. |
type |
str
|
Data type of the parameter (BOOL, INT, REAL, STRING, etc.). |
active |
bool
|
Whether this parameter is currently active/enabled. |
Example
param = DeviceStruct(id="001", var_name="mixer_speed", var_name_IN="MAIN.rMixerRPM", type="REAL", active=True) param_dict = param._to_dict()
MixerStructOutput
dataclass
Data structure for mixer output parameter definitions.
This class serves as a placeholder for mixer-specific output parameter structures. It can be extended to include mixer-specific output variables such as current mixing speed, motor status, temperature readings, etc.
Note
This class is currently empty and serves as a placeholder for future mixer-specific output parameter implementations.
Example
mixer_output = MixerStructOutput()
Future implementation might include:
>>> mixer_output.current_speed = 1500 # RPM
>>> mixer_output.motor_temperature = 65.5 # Celsius
__post_init__()
Placeholder for future implementation.