I am answering my own question. I think the S-Function block I was using was not a CMEX S-Function. I copied a C-code S-Function block from another woring program and edited the block to name it 'phase_det'. Doing this it did work.
The block I orignally used was labeled a 'Level 2 S-Function'. In the Simulink model once the block label is changed, such as calling it 'My Block' instead of 'Level 2 S-Function', it seems that there is now way to no what kind of block it is.
Am I missing something here?
Thanks