22 #License along with this library; if not, write to the Free Software |
22 #License along with this library; if not, write to the Free Software |
23 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 |
24 |
25 import string, os, sys, re |
25 import string, os, sys, re |
26 from plcopen import LoadProject |
26 from plcopen import LoadProject |
|
27 from collections import OrderedDict |
27 |
28 |
28 LANGUAGES = ["IL","ST","FBD","LD","SFC"] |
29 LANGUAGES = ["IL","ST","FBD","LD","SFC"] |
29 |
30 |
30 LOCATIONDATATYPES = {"X" : ["BOOL"], |
31 LOCATIONDATATYPES = {"X" : ["BOOL"], |
31 "B" : ["SINT", "USINT", "BYTE", "STRING"], |
32 "B" : ["SINT", "USINT", "BYTE", "STRING"], |
416 std_decl = get_standard_funtions(csv_file_to_table(open(os.path.join(ScriptDirectory,"iec_std.csv"))))#, True) |
417 std_decl = get_standard_funtions(csv_file_to_table(open(os.path.join(ScriptDirectory,"iec_std.csv"))))#, True) |
417 |
418 |
418 StdBlckLst.extend(std_decl) |
419 StdBlckLst.extend(std_decl) |
419 |
420 |
420 # Dictionary to speedup block type fetching by name |
421 # Dictionary to speedup block type fetching by name |
421 StdBlckDct = {} |
422 StdBlckDct = OrderedDict() |
422 |
423 |
423 for section in StdBlckLst: |
424 for section in StdBlckLst: |
424 for desc in section["list"]: |
425 for desc in section["list"]: |
425 words = desc["comment"].split('"') |
426 words = desc["comment"].split('"') |
426 if len(words) > 1: |
427 if len(words) > 1: |