Use this instruction for conditional compilation within the ST editor.
#IF IsInstructionSupported('F145_WRITE_DATA') <> 0 #THEN
(*condition TRUE: first part is compiled and executed*)
#ELSE
(*condition FALSE: second part is compiled and executed*)
OutputCompilerError('Instruction NOT supported');
#END_IF;
This code with an FP0 PLC returns the following error: