InoDrive / IO / get_input


InoDrive.IO.get_input(self, input=None)

Get Voltage State of Specific Configurable Input.

Arguments:

self (Object): Reference to IO Instance.
input (Integer): Module’s Input Range (0 to 3).

Returns:

Integer:

• 0 – Low Voltage Input Signal
• 1 – High Voltage Input Signal

import CkInoDriveAPI

# Instantiate InoDrive Object and Connect by Name
Drive = CkInoDriveAPI.InoDrive(target='Name', autoConnect=True)

# Get All Input States
inputs = [0, 1, 2 ,3]

for item in inputs:
    state = Drive.IO.get_input(item)
    if state == 0:
        print(f"Input {item} is low.")
    else:
        print(f"Input {item} is high.")