The emitted ST code for assigning a CIEC_TIME is not working. The emitted code is for VAR:=T#2s;
is
VAR() = CIEC_TIME.fromString("T#2s");
A working solution is to change the generated code to
VAR().fromString("T#2s");
which would also be more efficient
Issues: #307
News: 2013/10/first-maintenance-release-for-4daic-14
The problem with your proposal is that it would only work in assignments. However we also need to correctly export it if a TIME literal is used in an expression e.g., IF transition condition it also needs to be correct. This has also been reported in [issues:#307]
Therefore I would propose to add a constructor for CIEC_TIME which would internally use fromString so that you expression should than result in the following exported code:
VAR() = CIEC_TIME("T#2s");
In the end with optimizations it will be the same code anyhow.
Related
Issues:
#307Last edit: Zoitl Alois 2013-10-15
The proposed solution seems fine to me!
An updated FORTE is available in cest [forte:da35fc] the export filter will follow in the next days.
Maybe we have to reconsider this as well for other more complex literals (e.g., DATE) as well.
Related
Commit: [da35fc]
final fix in cset [fordiac-ide:c94285]
Related
Commit: [c94285]