How to get a 24 V signal generated when the input circuit state changes?
simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. A circuit based on industrial timers. Top: the desired timing diagram. Centre: the circuit. Bottom: the timing diagram again but showing the internal operation.

Industrial timers are available with DIN rail mounting, etc., and 24 V is the standard operating voltages. They are robust and have plastic enclosures and screw terminals. This solution uses an ON delay and an OFF delay timer.


The on-delay timer output turns on some time after the input turns on. It turns off immediately supply is switched off.
The off-delay timer output turns on immediately with the trigger input. It holds on for some time after the trigger signal has been removed. To maintain output it needs 24 V power.
The changeover contacts of T1 and T2 are wired in opposition so that the output turns on when the status of each does not match.


If I have misinterpreted your requirements then please add a timing diagram into your question. You can do this quite well using ASCII art and the code tags as shown below.

   _____      _____
__|     |____|     |_____
   _     _    _     _
__| |___| |__| |___| |___




Response to PLC answer:

You can streamline your PLC solution using the Rising Edge and Falling Edge contacts. These are edge triggered and remain on for one scan of the program.

  X1                   Y0
--|^|---+-------------(SET)----
        |
  X1    |
--|v|---+

  Y0              +TMR-T1---+
--| |-------------+   1.000s|
                  +---------+

T1.Done                Y0
--| |-----------------(RST)----