PLCgen: Allow user-supplied text at the top of the generated PLC code.
As stated in #679 "Industrial Usage", the item with V-10
, the PLC code generator should "Include the used versions of the input models, synthesis software, and code generator in the generated code".
This is only partly implementable in ESCET.
- ESCET tools can query their own version when they run. That covers "used version .... code generator in the generated code".
- ESCET does not track versions of CIF models, nor does it track how they are created or how they were changed. "used versions of input models" is unknown to ESCET.
- ESCET can query the current version of the synthesis software, but it doesn't know the time that the software was used to derive the input model, and as such current version is of limited use.
- ESCET has no knowledge of all other software that can be used to create or synthesize a model. It also cannot obtain version numbers of such software.
Much of the requested information is simply not available within ESCET, and for some part will never be available without outside assistance. Version tracking of models and other (non-ESCET) software is not a goal for ESCET itself.
To resolve V-10
, the PLC code generator assumes a third-party will supply all required information that cannot be derived by ESCET itself.
There are industrial strength tools for this job. The simpler tools are version control systems like git
, hg
, or svn
(all freely available), and it goes up to complete commercial document handling and tracking systems with automatic and reproducible construction and testing of derived artefacts using a build server, complete with workflow management, issue management, etc. A relatively simple such system that is freely available is the Gitlab
software (not to be confused with the gitlab
project hosting site that exists). No doubt there are others.
With such a system in place, it should be a relatively straightforward job to obtain the requested information about input models and versions of used software.
The only remaining problem is then to insert that information into the generated output of the PLC code generator. This issue addresses that.
The idea is to allow the user to supply an ASCII text-file to the PLC code generator, which can contain any text that is desired. To insert the version of the used PLC code generator into the document, a special text ${plcgen-version}
can be written in the supplied text file. The PLC code generator loads the file and looks for that special text. If found it is replaced by the actual version number of the PLC code generator software of the running program.
In a similar way, other information such as a time stamp can be added.
If no text file is supplied, the PLC code generator will use a default text to insert.
Addresses #679