InoDrive / IO / get_input_polarity


InoDrive.IO.get_input_polarity(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: String – Input Polarity 'PNP' or 'NPN'.

import CkInoDriveAPI

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

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

for item in inputs:
    polarity = Drive.IO.get_input_polarity(item)
    if polarity == 'NPN':
        print(f"Input {item} is set to NPN.")
    else:
        print(f"Input {item} is set to PNP.")