示例#1
0
 def __init__(self):
     self.__model = iec61850.IedModel_create('testmodel')
     lDevice1 = iec61850.LogicalDevice_create('SENSORS', self.__model)
     lln0 = iec61850.LogicalNode_create('LLN0', lDevice1)
     ttmp1 = iec61850.LogicalNode_create('TTMP1', lDevice1)
     iec61850.CDC_SAV_create('TmpSv',  iec61850.toModelNode(ttmp1), 0, False)
     iec61850.CDC_ASG_create('TmpSp',  iec61850.toModelNode(ttmp1), 0, False)
     self.__iedServer = iec61850.IedServer_create(self.__model)
     iec61850.IedServer_start(self.__iedServer, tcpPort)
     if not(iec61850.IedServer_isRunning(self.__iedServer)):
         print('Starting server failed! Exit.\n')
         iec61850.IedServer_destroy(self.__iedServer)
         sys.exit(-1)
示例#2
0
 def __init__(self):
     self.__model = iec61850.IedModel_create("testmodel")
     lDevice1 = iec61850.LogicalDevice_create("SENSORS", self.__model)
     lln0 = iec61850.LogicalNode_create("LLN0", lDevice1)
     ttmp1 = iec61850.LogicalNode_create("TTMP1", lDevice1)
     iec61850.CDC_SAV_create("TmpSv", iec61850.toModelNode(ttmp1), 0, False)
     iec61850.CDC_ASG_create("TmpSp", iec61850.toModelNode(ttmp1), 0, False)
     self.__iedServer = iec61850.IedServer_create(self.__model)
     iec61850.IedServer_start(self.__iedServer, tcpPort)
     if not (iec61850.IedServer_isRunning(self.__iedServer)):
         print("Starting server failed! Exit.\n")
         iec61850.IedServer_destroy(self.__iedServer)
         sys.exit(-1)
示例#3
0
def signal_handler(signal, frame):
    global running
    running = 0
    print("You pressed Ctrl+C!")


if __name__ == "__main__":
    now = datetime.now()
    current_time = now.strftime("%H:%M:%S")
    print("Starting MMS Server At Time %s" % current_time)

    # Create Model IED
    myModel = iec61850.IedModel_create("testmodel")
    # Create Logical Device
    lDevice1 = iec61850.LogicalDevice_create("SENSORS", myModel)
    # Create Logical Node
    ttmp1 = iec61850.LogicalNode_create("TTMP1", lDevice1)
    # Create Model Node
    iec61850.CDC_ASG_create("TmpSp", iec61850.toModelNode(ttmp1), 0, False)
    iec61850.CDC_VSG_create("TmpSt", iec61850.toModelNode(ttmp1), 0)
    # Create Data Object
    do1 = iec61850.DataObject_create("Temp1", iec61850.toModelNode(ttmp1), 0)
    # Create Data Attribute
    fl = iec61850.DataAttribute_create(
        "float",
        iec61850.toModelNode(do1),
        iec61850.IEC61850_FLOAT64,
        iec61850.IEC61850_FC_MX,
        0,
        0,