here comes your solution in codesys
i have it as a project and as a export (it is in PLC_PRG so you can see what happens, but you can rename it to a Function Block.
the vdiagram contains 100 subvis,but you only see one.
if you want to change dimensions, use a texteditor in the export, faster.