Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get controller state ? #310

Open
tejas987 opened this issue Jan 18, 2024 · 1 comment
Open

How to get controller state ? #310

tejas987 opened this issue Jan 18, 2024 · 1 comment
Labels
question Further information is requested

Comments

@tejas987
Copy link

tejas987 commented Jan 18, 2024

I want to get in which state my controller in from following ?

States defined in CIP Spec Vol 1, chapter 5, Identity Object

STATES = {
0: "Nonexistent",
1: "Device Self Testing",
2: "Standby",
3: "Operational",
4: "Major Recoverable Fault",
5: "Major Unrecoverable Fault",
**{i: "Reserved" for i in range(6, 255)},
255: "Default for Get_Attributes_All service",
}

From identity object i am able to get status(RUN, Prograam or TEST) of controller but not exact state ?

@tejas987 tejas987 added the question Further information is requested label Jan 18, 2024
@Colt-H
Copy link
Contributor

Colt-H commented May 1, 2024

State is an optional parameter in the CIP spec, does your device support it? The below code snip should get you where you need to go, make sure to update your device path.

with CIPDriver("10.0.0.1") as device:
    data = device.generic_message(
            service=Services.get_attribute_single,
            class_code=ClassCode.identity_object,
            instance=b"\x01",
            attribute=8, #State attribute per CIP Spec
            data_type='USINT'
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants