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

SOP/UOP may not be available #7

Open
gavanderhoorn opened this issue Feb 3, 2021 · 1 comment
Open

SOP/UOP may not be available #7

gavanderhoorn opened this issue Feb 3, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@gavanderhoorn
Copy link
Owner

Depending on how the controller is configured, the UOP and/or SOP IO elements may not be available.

This makes it impossible to use various functions in controller.py:

def tp_enabled(conx):
"""Determine whether the Teach Pendant is currently enabled.
Checks SOP output index 7 (from kliosop.kl).
:returns: True if the TP is 'ON'
:rtype: bool
"""
return io_read_sopout(conx, idx=kliosop.SOPO_TPENBL) == IO_ON
def is_faulted(conx):
"""Determine whether the controller is currently faulted.
Checks SOP output index 3 (from kliosop.kl).
:returns: True if there is an active fault on the controller
:rtype: bool
"""
return io_read_sopout(conx, idx=kliosop.SOPO_FAULT) == IO_ON
def is_e_stopped(conx):
"""Determine whether the controller is currently e-stopped.
Checks SOP input index 0 (from kliosop.kl).
:returns: True if the e-stop is active
:rtype: bool
"""
# active low input
return io_read_sopin(conx, idx=kliosop.SOPI_ESTOP) == IO_OFF
def in_remote_mode(conx):
"""Determine whether the controller is in remote mode.
Checks SOP output index 0 (from kliosop.kl).
:returns: True if a program is running.
:rtype: bool
"""
return io_read_sopout(conx, idx=kliosop.SOPO_REMOTE) == IO_ON
def is_program_running(conx):
"""Determine whether the controller is executing a program.
NOTE: this does not check for any specific program, but will return
True whenever the currently selected program (or any of its children)
are not PAUSED or ABORTED.
Checks UOP output index 3 (from kliouop.kl).
:returns: True if a program is running.
:rtype: bool
"""
return io_read_uopout(conx, idx=kliouop.UOPO_PROGRUN) == IO_ON
def is_program_paused(conx):
"""Determine whether there is a paused program on the controller.
NOTE: this does not check for any specific program, but will return
True whenever the currently selected program is PAUSED.
Checks UOP output index 4 (from kliouop.kl).
:returns: True if a program is paused.
:rtype: bool
"""
return io_read_uopout(conx, idx=kliouop.UOPO_PAUSED) == IO_ON

as they make use of those elements.

@gavanderhoorn gavanderhoorn added the bug Something isn't working label Feb 3, 2021
gavanderhoorn added a commit that referenced this issue Jun 11, 2021
@gavanderhoorn
Copy link
Owner Author

With 9afa99a at least the example doesn't crash any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant