Skip to main content
Skip table of contents

get_digital_input(index)

Features

This function reads the signals from digital contact points of the controller and reads the digital input contact value.

Parameters

Parameter NameData TypeDefault ValueDescription

index

int

-

A number 1 - 16 which means the contact number of I/O mounted on the controller.

Return

ValueDescription

1

ON

0

OFF

Negative valueFailed

Exception

ExceptionDescription

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example

PY
in1 = get_digital_input(1)	# Reads the no. 1 contact
in8 = get_digital_input(8)	# Reads the no. 8 contact
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.