Hello, welcome to the forum. You didn't mention what PLC type or software you are using. In the older Simatic Manager step 7, if you have created a function block in LAD, you can convert this to STL by choosing file menu View/STL or by pressing shortcut Ctrl+2