What i did was click right mousebutton at "Function Blocks" in the meny to the left in CX-Programmer. here you can choose "Insert function block - ladder"
And then you just set the in- and outputs, and then you make the program of the function block underneath.
When calling the function block in the programsection just choose "new function block call" in the meny, and choose witch function block you like to use.
Insert a function block - call it what you will.
Develop your code in ladder with symbols - you must have symbols.
Highlight the rung, copy, open up the function block and paste in your copied ladder. Then adjust inputs and outputs - finisshed.