Menu

#779 Wrong generated code for ST assignment of CIEC_TIME

1.4.x
closed-fixed
4DIAC-IDE
Bug
7
2013-10-16
2013-10-15
No

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

Related

Issues: #307
News: 2013/10/first-maintenance-release-for-4daic-14

Discussion

  • Zoitl Alois

    Zoitl Alois - 2013-10-15

    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: #307


    Last edit: Zoitl Alois 2013-10-15
  • Zoitl Alois

    Zoitl Alois - 2013-10-15
    • Milestone: Bug <don't use=""> --> 1.4.x
     
  • Martin Melik-Merkumians

    The proposed solution seems fine to me!

     
  • Zoitl Alois

    Zoitl Alois - 2013-10-15

    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]

  • Zoitl Alois

    Zoitl Alois - 2013-10-16
    • status: open --> closed-fixed
     
  • Zoitl Alois

    Zoitl Alois - 2013-10-16

    final fix in cset [fordiac-ide:c94285]

     

    Related

    Commit: [c94285]


Log in to post a comment.