# HG changeset patch # User Edouard Tisserant # Date 1329694621 -3600 # Node ID ea237e1431ec23b007c410b1edbd7ca30df418eb # Parent 95d165193770968eeecc77c2ebc2125d672315f5 Enable RTC in standard FB lib diff -r 95d165193770 -r ea237e1431ec PLCControler.py --- a/PLCControler.py Fri Feb 17 00:13:19 2012 +0100 +++ b/PLCControler.py Mon Feb 20 00:37:01 2012 +0100 @@ -1285,7 +1285,7 @@ if blocktype["name"] == type: if inputs is not None and inputs != "undefined": block_inputs = tuple([var_type for name, var_type, modifier in blocktype["inputs"]]) - if reduce(lambda x, y: x and y, map(lambda x: x[0] == "ANY" or self.IsOfType(*x), zip(inputs, block_inputs))): + if reduce(lambda x, y: x and y, map(lambda x: x[0] == "ANY" or self.IsOfType(*x), zip(inputs, block_inputs)), True): return blocktype else: if result_blocktype is not None: diff -r 95d165193770 -r ea237e1431ec plcopen/structures.py --- a/plcopen/structures.py Fri Feb 17 00:13:19 2012 +0100 +++ b/plcopen/structures.py Mon Feb 20 00:37:01 2012 +0100 @@ -219,12 +219,12 @@ "generate" : generate_block, "initialise" : initialise_block}, ]}, {"name" : _("Additional function blocks"), "list": -## {"name" : "RTC", "type" : "functionBlock", "extensible" : False, -## "inputs" : [("EN","BOOL","none"),("PDT","DATE_AND_TIME","none")], -## "outputs" : [("Q","BOOL","none"),("CDT","DATE_AND_TIME","none")], -## "comment" : _("Real time clock\nThe real time clock has many uses including time stamping, setting dates and times of day in batch reports, in alarm messages and so on."), -## "generate" : generate_block, "initialise" : initialise_block}, - [{"name" : "INTEGRAL", "type" : "functionBlock", "extensible" : False, + [{"name" : "RTC", "type" : "functionBlock", "extensible" : False, + "inputs" : [("IN","BOOL","none"),("PDT","DATE_AND_TIME","none")], + "outputs" : [("Q","BOOL","none"),("CDT","DATE_AND_TIME","none")], + "comment" : _("Real time clock\nThe real time clock has many uses including time stamping, setting dates and times of day in batch reports, in alarm messages and so on."), + "generate" : generate_block, "initialise" : initialise_block}, + {"name" : "INTEGRAL", "type" : "functionBlock", "extensible" : False, "inputs" : [("RUN","BOOL","none"),("R1","BOOL","none"),("XIN","REAL","none"),("X0","REAL","none"),("CYCLE","TIME","none")], "outputs" : [("Q","BOOL","none"),("XOUT","REAL","none")], "comment" : _("Integral\nThe integral function block integrates the value of input XIN over time."),