plcopen/plcopen.py
changeset 6 c8cf918ee7ea
parent 2 93bc4c2cf376
child 27 dae55dd9ee14
equal deleted inserted replaced
5:f8652b073e84 6:c8cf918ee7ea
    21 #You should have received a copy of the GNU General Public
    21 #You should have received a copy of the GNU General Public
    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 from xmlclass import *
    25 from xmlclass import *
       
    26 import os, sys
    26 
    27 
    27 """
    28 """
    28 Dictionary that makes the relation between var names in plcopen and displayed values
    29 Dictionary that makes the relation between var names in plcopen and displayed values
    29 """
    30 """
    30 VarTypes = {"Local" : "localVars", "Temp" : "tempVars", "Input" : "inputVars",
    31 VarTypes = {"Local" : "localVars", "Temp" : "tempVars", "Input" : "inputVars",
    42 QualifierList = {"N" : False, "R" : False, "S" : False, "L" : True, "D" : True, 
    43 QualifierList = {"N" : False, "R" : False, "S" : False, "L" : True, "D" : True, 
    43     "P" : False, "P0" : False, "P1" : False, "SD" : True, "DS" : True, "SL" : True}
    44     "P" : False, "P0" : False, "P1" : False, "SD" : True, "DS" : True, "SL" : True}
    44 
    45 
    45 PLCOpenClasses = {}
    46 PLCOpenClasses = {}
    46 PLCOpenTypes = {}
    47 PLCOpenTypes = {}
    47 GenerateClassesFromXSD("plcopen/TC6_XML_V10_B.xsd")
    48 GenerateClassesFromXSD(os.path.join(sys.path[0], "plcopen/TC6_XML_V10_B.xsd"))
    48 CreateClasses(PLCOpenClasses, PLCOpenTypes)
    49 CreateClasses(PLCOpenClasses, PLCOpenTypes)
    49 
    50 
    50 if "dataType" in PLCOpenClasses:
    51 if "dataType" in PLCOpenClasses:
    51     cls = PLCOpenClasses["dataType"]
    52     cls = PLCOpenClasses["dataType"]
    52     cls.value = None
    53     cls.value = None