SECS I
module imports.
- class secsgem.secsi.SecsISettings(**kwargs)[source]
Settings for SECS-I connection.
These attributes can be initialized in the constructor and accessed as property.
Example
>>> import secsgem.secsi >>> >>> settings = secsgem.secsi.SecsISettings(port="COM1") >>> settings.port 'COM1' >>> settings.speed 9600
- property port: str
Serial port.
Default: “”
- property speed: int
Serial port baud rate.
Default: 9600
- property name: str
Name of this configuration.
- class secsgem.secsi.SecsIProtocol(settings)[source]
Implementation for SECS-I protocol.
- message_type
alias of
SecsIMessage
- class secsgem.secsi.SecsIHeader(system, session_id, stream=0, function=0, block=0, from_equipment=False, require_response=False, last_block=True)[source]
Generic SECS I header.
Base for different specific headers
- property block: int
Get block number.
- property from_equipment: bool
Get if the message is from equipment (True) or host (False).
This is the reverse bit (r-bit).
- property last_block: bool
Get if the message is the last of a multi-block message.
This is the end bit (e-bit).
- encode()[source]
Encode header to SECS I message.
- Return type:
bytes- Returns:
encoded header
Example
>>> import secsgem.secsi >>> import secsgem.common >>> >>> header = secsgem.secsi.SecsIHeader(2, 100) >>> secsgem.common.format_hex(header.encode()) '00:64:00:00:80:00:00:00:00:02'