Skip to main content

Names and Naming Rules

This chapter covers the encoding of object names and folder names, as well as the applicable naming rules, and the folders reserved for CODESYS File-Based Storage.

Encoding of names

Object names and folder names sometimes contain characters which are not permitted in file system paths or which have a special meaning. These characters are encoded by CODESYS File-Based Storage so that the project remains portable between Windows and Linux.

The following characters are encoded:

  • Characters which Windows does not allow in a path: < > : " / \ | ? *

  • Caret (^) because since it identifies container directories

  • All control characters

  • Period (.) because it separates the name from the class part and language part

Each encoded character is written as two underscores followed by the two-digit hexadecimal code of the character. Thus the point becomes __2e, the slash becomes __2f, and the caret becomes __5e.

If an object name matches a reserved Windows device name, then the name is enclosed in underscores. Reserved Windows device names are CON, PRN, AUX, NUL, COM1 to COM9, and LPT1 to LPT9. CON will become _CON_.

Naming rules

To make sure that projects remain portable and suitable for version control systems, CODESYS File-Based Storage will check the object names. Violations are reported.

  • The object name, including the class suffix and the language suffix, must not exceed 240 characters. A folder name must also not exceed 240 characters.

  • Object names must not contain a hash symbol (#).

  • Object names must not begin or end with a space character.

  • Two folders cannot have the same name, even in different parts of the project. The comparison does not take case sensitivity into account.

  • A programming object must not contain two methods with the same name.

  • A project must not reference two libraries using the same namespace.

If CODESYS detects a violation during a conversion, then the problem will be reported. If possible, a quick fix will be provided. The Convert Project command describes the available quick fixes.

Reserved folders

Several folders are used by CODESYS File-Based Storage for internal purposes, including .FBS_Project_Related, .auxiliaries, and .sidecars. Do not create project folders with these names.

The .auxiliaries and .sidecars folders include local or generated contents. Always exclude these folders from version control systems.