Using the analog input as a digital input

Question:

How can the analog input be used as a digital input?

Answer:

The analog input can be used as a digital input by means of the comparator of function block PCTRL1. For this purpose the analog input (e. g. AIN1) is connected with the input PCTRL1-ACT (C0412/5 = 1). Via code C0181 (PCTRL1-SET2) a frequency is entered, required by the comparator and corresponding to the max. input voltage of the analog input signal. The switch for the setpoint source must be set to the signal PCTRL1-SET2 (C0145 = 1). At the output signal PCTRL1-SET=ACT the desired digital signal is created.

Attention: The jumpers of the application-I/O / the DIP switches of the standard-I/O have to be configured to the voltage range 0 to 10 V for the used analog input and the applied voltage is not allowed to exceed 24 V DC!

Example:
At the analog input 1 a voltage signal of 0 V (LOW level) or 20 V (HIGH level) is applied. The max. output frequency C0011 is set to 50 Hz. The analog input 1 is connected with the input PCTRL1-ACT (C0412/5 = 1). Code C0145 is to be set to 1 (switch for the setpoint source PCTRL1-SET2). Via code C0181 (PCTRL1-SET2) 50 Hz are set (a fine adjustment can be required), so that the comparator is switched over when 20 V are applied to the analog input and at the output PCTRL1-SET=ACT a HIGH level signal is applied, which can e. g. be used for activating the JOG value 1 (C0410/1 = 229).

Following codes have been parameterized for this example deviating from the Lenze default setting:
  • C0145    = 1       (Selection setpoint selection via PCTRL1-SET2)
  • C0181    = 50Hz (Source setpoint PCTRL1-SET2)
  • C0410/1 = 229    (NSET1-JOG1/3 connected with  PCTRL1-SET=ACT)
  • C0412/5 = 1        (Actual value PCRTL1-ACT is determined via analog input  AIN1)

Note:
Regarding the application-I/O the hysteresis of the comparator can be set via code C0235.

URL for linking this AKB article: https://www.lenze.com/en-de/go/akb/200511011/1/
Contact form