I have done this. You can't do it strictly in simulation mode.
You have to use the run time that comes with CoDeSys. it is a time limited version. It lets you use your PC as a soft PLC for 2 hours (I think that's the time limit).
But this means that you have to change your target in your project to the one you will run on your PC. I usually use V3 Win 32 or something. I'm not on my laptop with CoDeSys right now. Before loading on your actual hardware you will have to change the target back.
It also works with Ethernet/IP