Converting Projects from CODESYS 3 for CODESYS 4
In this section, you will import a library from CODESYS 3 to CODESYS 4.
Importing a compiled library
Requirement: The compiled library is available as a file.
Save the compiled library in a folder which you can access from within the project via a relative path. Alternatively, you could also save the file in a library repository.
Open the
Libraries.jsonfile of the project or application.Add an entry with the property
pathand specify the path in URI notation. The file extension determines how the library will be handled.Select the Resolve Libraries command.
The library will be embedded and the resolved version and the SHA384 checksum will be entered into the
Libraries.lock.jsonfile.
Importing a source library
Requirement:
The library can be available either as a file-based FBSLIB file or as a binary LIBRARY file. If the file is in LIBRARY format, then in CODESYS 3 first use the Convert Project command to convert it into the file-based format (FBSLIB).
All objects to be imported are written in structured text.
In CODESYS 3, check if the library contains objects in programming languages other than structured text. If necessary, convert these objects to structured text.
Check if the library contains objects in the XML.V3 fallback format. If necessary, use the Migrate Objects command to convert the objects into the native text format. The operation is irreversible. Back up the library before running the command.
Use the Save Project command to save the library in CODESYS 3 and close the project.
Load the FBSLIB file via the workspace in CODESYS 4 and open the library project.
Select the Resolve Libraries command and check the notifications.
The
.sidecars,.auxiliaries, and.FBS_Project_Relatedfolders will be reserved for the add-on. They will not be used in CODESYS 4. The folders remain in the library folder and should still not be included in version control.
The library will be displayed as a library project in the workspace navigator and it will be editable. Objects of a type not supported by CODESYS 4 will not be available. A new object GUID will be generated for each object.
Common problems
Problem | Fix |
|---|---|
An object is not displayed in CODESYS 4. | The object type is not yet supported by CODESYS 4 or the object is not written in structured text. |
An object is opened in a read-only editor. | The contents of the file cannot be interpreted. Check the file in a text editor. |
A library reference is not resolved. | The reference originates from the library manager of CODESYS 3. Enter the reference in the |
An object name is rejected. | The name violates the naming rules of file-based storage. Rename the object in CODESYS 3 and repeat the process. |