Import from a S5 Project File

POUs can read from Siemens S5 program files (*.s5d). The code that it uses is MC5 Code that can be run by S5 SPS. In general, MC5 Code corresponds with the STEP5 Instruction List (without symbol names) with which the programmer is familiar. The S5D also contains the line comments from the STEP5 Instruction List. Since an S5D file contains only absolute addresses with no symbol names, CoDeSys searches for the symbol names among the current CoDeSys project variables. If none are found, the absolute address is left unchanged. Therefore, if you feel the symbol name is useful, import the SEQ file before the S5 file.

You first select the S5D file in a standard Windows dialog box. Another box pops up which contains the list of POUs from which you can select. It is best to select all of them. You can also select to leave the POUs in the STEP5 IL language or to convert them to IL, LD or FBD.

Symbol names will be used in place of absolute names as much as possible. If CoDeSys finds the instruction “U M12.0” during the import, it will search for a global variable set at memory location M12.0. The first declaration that fits this description will be taken and the instruction will be imported as “U-Name” instead of “U M12.0” (the name of the identifier for the memory location is M12.0).

At times additional variables may be needed during an import or code conversion. These additional variables will be declared globally. For example, R_TRIG instances are needed to reproduce edge-triggered inputs (e.g., in a S5 counter).