Skip to main content

ProjectInfo.json

In CODESYS 4, the project information is stored in the UTF-8-encoded ProjectInfo.json file. In the case of a device project, the file is located in the directory *.fbsdev. In the case of a library project, the folder is located in the directory *.fbslib.

The most important project information is located at the top level of the file. The remaining keys are located in the dynamically expandable object or customProperties dictionary.

Example 48. Example of a ProjectInfo.json file

{  
    "title": "C4 Test Compiled Library",  
    "version": "1.0.0-alpha3+build-42",  
    "author": "Team CBE",  "company": 
    "CODESYS Development GmbH",  
    "description": "Test library for compiled library creation",  
    "defaultNamespace": "C4CompiledTestLib",  
    "placeholder": "C4CompiledTestLib",
    "categories": ["System|SysLibs", "Docs|Fieldbus|Modbus", "Use Cases", 
    "customProperties": {    
        "DocFormat": "reStructuredText", 
        "SomeTime": {"type": "DateTime", "value": "2024-12-24T15:24:12" }
  }
}


Keys defined in the ProjectInfo.json file

Most keys correspond exactly to the project information in CODESYS 3, but with a modified naming convention.

Table 19.

Key

Type

Description

title

string

Title of the project

Required for libraries

version

string

Version of the project

Required for libraries

company

string

Manufacturer of the project

Required for libraries

author

string

Author of the project

description

string

Description of the project

defaultNamespace

string

Standard namespace for libraries. It is recommended to set this property for ordinary libraries.

Insignificant for device projects

released

bool

true: The library is released.

placeholder

string

Placeholder used to resolve the library

For more information, see the following: Common Libraries

autoResolveUnbound

bool

true: Automatic placeholder resolution is requested.

Recommended for "standalone" libraries whose placeholders are not resolved by other sources, for example a device description.

isContainerLibrary

bool

true: The library is a container library.

For more information, see the following: Container Libraries

isInterfaceLibrary

bool

true: The library is an interface library.

For more information, see the following: Interface Libraries

isCommonLibraryContainer

bool

true: The library is a container library which must be resolved via placeholders.

For more information, see the following: Common Libraries

languageModelAttribute

string

Should be set to qualified-access-only for new libraries to enforce qualified access via the namespace prefix

generateProjectInfoFunctions

bool

Controls the generation of functions which can be used for programmatic access to project properties within the application

Note: This key is currently not yet being evaluated in CODESYS 4.

generateLibraryInfoFunctions

bool

Controls the generation of functions which are used for programmatic access to library properties within the application

Note: This key is currently not yet being evaluated in CODESYS 4.

categories

string[]

List of strings which define membership in project categories

customProperties

object{}

Properties which are not rigidly predefined

As in CODESYS 3, the list of properties in CODESYS 4 can be dynamically expanded by the user. However, only the following data types are available for this:

  • string

  • number: Value range or .NET type int32

  • boolean: true, false

  • Version: .NET System.Version represented as a string, for example "1.2.3.4"

  • DateTime

The default types string, number, and boolean are written directly as the respective JSON literal. For the types Version and DateTime, an ID via a type field is required to distinguish them from normal strings. This is why they are written as JSON objects with the members "type" and "value", for example:

"SomeVersion": {"type": "Version", "value": "1.2.3.4" },

"SomeTime": {"type": "DateTime", "value": "2024-12-24T15:24:12" },

v3Meta

object{}

Metadata not relevant for CODESYS 4, stored by CODESYS 3 in a file-based storage format

It is only relevant if a file-based storage CODESYS 3 project should be opened in CODESYS 4. Data which can be ignored without loss of functionality will be ignored. The remaining data will generate an error message in CODESYS 4. Plug-in-specific data is evaluated by an interface. All properties which are not recognized by any plug-in will generate an error.



Library categories

The library categories are used to group libraries hierarchically. A library can belong to one or more categories or none at all. The categories themselves are structured hierarchically.

The library categories are stored as a categories list in ProjectInfo.json.

  • The list does not need to exist.

  • The list can contain any number of categories.

  • The identifiers of the hierarchical levels of the categories are each separated by the pipe character (|).

  • A category identifier must not be empty or consist only of whitespace.

  • The characters of the Unicode categories "Control Characters" (U+0000-U+001F, U+007F-U+009F), "Line Separator" (U+2028), and "Paragraph Separator" (U+2029) are excluded.

Example of valid categories: ["System|SysLibs", "Docs|Fieldbus|Sercos", "Use Cases"]

Example of invalid categories:  ["", "A||B", "A|  |B", "A\r\nB"]