Skip to content

Constants

slmp.constants

SLMP 4E binary constants and command/device definitions.

Classes

Command

Bases: IntEnum

Command list from SH080956ENGN 5.1.

Source code in slmp\constants.py
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
class Command(IntEnum):
    """Command list from SH080956ENGN 5.1."""

    # Device
    DEVICE_READ = 0x0401
    DEVICE_WRITE = 0x1401
    DEVICE_READ_RANDOM = 0x0403
    DEVICE_WRITE_RANDOM = 0x1402
    DEVICE_ENTRY_MONITOR = 0x0801
    DEVICE_EXECUTE_MONITOR = 0x0802
    DEVICE_READ_BLOCK = 0x0406
    DEVICE_WRITE_BLOCK = 0x1406

    # Label
    LABEL_ARRAY_READ = 0x041A
    LABEL_ARRAY_WRITE = 0x141A
    LABEL_READ_RANDOM = 0x041C
    LABEL_WRITE_RANDOM = 0x141B

    # Memory / Extend unit
    MEMORY_READ = 0x0613
    MEMORY_WRITE = 0x1613
    EXTEND_UNIT_READ = 0x0601
    EXTEND_UNIT_WRITE = 0x1601

    # Remote control
    REMOTE_RUN = 0x1001
    REMOTE_STOP = 0x1002
    REMOTE_PAUSE = 0x1003
    REMOTE_LATCH_CLEAR = 0x1005
    REMOTE_RESET = 0x1006
    READ_TYPE_NAME = 0x0101

    # Remote password
    REMOTE_PASSWORD_LOCK = 0x1631
    REMOTE_PASSWORD_UNLOCK = 0x1630

    # Other
    SELF_TEST = 0x0619
    CLEAR_ERROR = 0x1617

DeviceCode dataclass

Device code and number radix.

Source code in slmp\constants.py
115
116
117
118
119
120
121
@dataclass(frozen=True)
class DeviceCode:
    """Device code and number radix."""

    code: int
    radix: int  # 10 or 16
    unit: DeviceUnit = DeviceUnit.WORD

DeviceUnit

Bases: IntEnum

Device unit (bit or word).

Source code in slmp\constants.py
28
29
30
31
32
class DeviceUnit(IntEnum):
    """Device unit (bit or word)."""

    BIT = 0
    WORD = 1

FrameType

Bases: str, Enum

SLMP frame type (3E or 4E).

Source code in slmp\constants.py
14
15
16
17
18
class FrameType(str, Enum):
    """SLMP frame type (3E or 4E)."""

    FRAME_3E = "3e"
    FRAME_4E = "4e"

ModuleIONo

Bases: IntEnum

Request destination module I/O No. from SH080956ENGN 4.2.

Source code in slmp\constants.py
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
class ModuleIONo(IntEnum):
    """Request destination module I/O No. from SH080956ENGN 4.2."""

    OWN_STATION = 0x03FF
    CONTROL_CPU = 0x03FF
    MULTIPLE_CPU_1 = 0x03E0
    MULTIPLE_CPU_2 = 0x03E1
    MULTIPLE_CPU_3 = 0x03E2
    MULTIPLE_CPU_4 = 0x03E3
    CONTROL_SYSTEM_CPU = 0x03D0
    STANDBY_SYSTEM_CPU = 0x03D1
    SYSTEM_A_CPU = 0x03D2
    SYSTEM_B_CPU = 0x03D3

    # Remote head aliases
    REMOTE_HEAD_1 = 0x03E0
    REMOTE_HEAD_2 = 0x03E1
    CONTROL_SYSTEM_REMOTE_HEAD = 0x03D0
    STANDBY_SYSTEM_REMOTE_HEAD = 0x03D1

PLCSeries

Bases: str, Enum

Series option for subcommand compatibility.

Source code in slmp\constants.py
21
22
23
24
25
class PLCSeries(str, Enum):
    """Series option for subcommand compatibility."""

    QL = "ql"  # MELSEC-Q/L compatible (0000/0001)
    IQR = "iqr"  # MELSEC iQ-R/iQ-L (0002/0003)