# HG changeset patch # User laurent # Date 1307370548 -7200 # Node ID 24f1118358051e51db2b639fc09e8da7f7dc49e6 # Parent 82fa901a216085d96ea3f7252e9b4e737897b664 Fixing REAL_TO_INT conversion (behaved like a trunc and not like a round) diff -r 82fa901a2160 -r 24f111835805 plcopen/structures.py --- a/plcopen/structures.py Tue May 24 19:37:14 2011 +0200 +++ b/plcopen/structures.py Mon Jun 06 16:29:08 2011 +0200 @@ -422,7 +422,12 @@ ANY_TO_ANY_LIST=[ # simple type conv are let as C cast - (("ANY_NUM","ANY_BIT"),("ANY_NUM","ANY_BIT"), ("return_type", "__move_", "IN_type")), + (("ANY_INT","ANY_BIT"),("ANY_NUM","ANY_BIT"), ("return_type", "__move_", "IN_type")), + (("ANY_REAL",),("ANY_REAL",), ("return_type", "__move_", "IN_type")), + # REAL_TO_INT + (("ANY_REAL",),("ANY_SINT",), ("return_type", "__real_to_sint", None)), + (("ANY_REAL",),("ANY_UINT",), ("return_type", "__real_to_uint", None)), + (("ANY_REAL",),("ANY_BIT",), ("return_type", "__real_to_bit", None)), # TO_TIME (("ANY_INT","ANY_BIT"),("ANY_DATE","TIME"), ("return_type", "__int_to_time", None)), (("ANY_REAL",),("ANY_DATE","TIME"), ("return_type", "__real_to_time", None)),