The MOC8101 is rated for an abs max LED current of 60mA. Using the circuit of comment#15. Assume the sensor is powered from 18.0VDC, that the PNP output transistor of the sensor drops 0.0V min (1.8V max), and that the forward voltage of the MOC8101 LED is <1.5V, then a current limiting resistor (R1) is required to keep the MOC8101 LED drive within its spec. LED current = (18-0.0-1.5)/R1 = (16.5V)/R1 = 0.06A. Thus, R1 must be greater than 275 ohms. For your use, R1 = 1000 ohms would be appropriate, giving an MOC8101 LED current of about 16.5mA and a current of 8.3mA minimum through the photo transistor (50% CTR from datasheet).