Page 8 , Figure 1 of LM2587 PWM controller datasheet
**broken link removed**
...shows the comp pin (pin 1)
If i do this isolated, using opto feedback (4N35 & TL431 error amp on secondary side) then how can i connect the opto transistor....can i just put the collactor to pin 1 and the emitter to ground...?
Why do you think that pin 1 should be used for feedback purpose? This operation isn't suggested by National in any application circuit, as far as I see. Pin 2 is intended for feedback.
As the National AN answers your previous questions to my opion, also from your other thread, e. g. regarding typical OC pole, which are still left open?