Digital input python script

Is there a way to get/catch a digital input signal from a URe3 in a python script? I have a socket tcp (ethernet) connection. On my cobot there are two buttons connected (start / stop) both give a digital input on the teach pendant. Get_digital_input doesn’t excists. Any ideas? I read something about a xml file…

get_standard_digital_in(n)

Get standard digital input signal level
See also get_configurable_digital_in and get_tool_digital_in.
Parameters n: The number (id) of the input, integer: [0:7]
Return Value boolean, The signal level.
Example command: get_standard_digital_in(1)
• Example Parameters:
• n is standard digital input 1
• Returns True or False

Hello @pho ,
I have a similar question to @t.vanderwal above – but for the tool’s digital input.

I am familiar with get_tool_digital_in(n), and I can send a string via python: popup(get_tool_digital_in(1)), and it properly prints a popup with the value on the pendant.

However, I am unaware of how to retrieve this data via TCPIP. I get an error when

In URBasic .py, I see the following:

def get_tool_digital_in(self, n):
‘’’
Get tool digital input signal level

    See also get configurable digital in and
    get standard digital in.

    Parameters:
    n: The number (id) of the input, integer: [0:1]

    Return Value:
    boolean, The signal level.
    '''
    raise NotImplementedError('Function Not yet implemented')

Would it be easier to do this with the rtde package? Please advise.

I am told that pickstate = mySocket.recv(1024) can be used but I’d like something simpler than handling all of that data if I can help it.

Thank you!