Well- just in time to not use it. You really don't have enough headroom to string 6x LEDs and a resistor in series with 24V. The HLMP datasheet shows the Vf as lying anywhere within 3.6V to 4V. If you go with 5x LEDs in series then you can get much better regulation and certainty of 20mA through the LEDs. A circuit that you can modulate with either your PLC or the 555 would look like shown below- just strap 555 pin 4 RST low when you use the PLC input- labeled EXT OC IN. Radio Shack sells a 20 pack of 2N4401 for $2.: View in a fixed-width font such as Courier.
. . 24VDC------------------+-----+------+------------------+ . | | | | . | | - - . | | v v . | | - - . | | | | . | | - - . | | v v . all transistors | | - - . | | | | . 2N4401 | [1.5K] - - . | | v v . | | - o o o - . [10K] | | | . | | - - . | | v v . | | - - . | | | | . | c - - . | |/ v v . EXT OC >-----------+-----+---| - - . IN | | |\\ | | . | c e c c . | \\| | |/ |/ . | |---+----+------- o o o --| . c /| |\\ |\\ . |/ e e e . 555 OUT>--[10K]--| | | | . |\\ | | | . e [1.5K] [150] [150] . | | | | . | | | | . GND ---------------+-----+------------+------------------+ .