Open libusr opened 6 years ago
Could you share the python library, I have problems trying to compile in python 3.6. When I impot the module I get the next error: ImportError: DLL load failed: No se puede encontrar el módulo especificado
Could you help me?
I have a version for Python 3.7, feel free to use it. Note that with this build the original problem regarding the utilization of the control operation remains unsolved. 20190826_libiec61850_py37.zip
Dear libusr, What is the OS thaht you use with python, Windows 32 64 bits or Linux?
I'm running it on Win10, 64 bit.
Maybe do you have some example to read comtrade files from IED??
Sorry, no example for this function yet. But I would also be interessted in the solution. Please share
I am trying to develope some code to do this but I don't know how to use the function iec61850.LinkedList_destroyDeep. Maybe have you ever work with this function?
I'm only familiar with the *.LinkedList_destroy function, which is part of the Python client example. No need for destroyDeep in my use cases.
Dear, I implement another method and it is succefull, but I am getting the next data: '\udcd0\udcf2\udcee\x0f\udcb9\n' 'p\udcf0\udcee\x0f%\udc93' 'p\udcf3\udcee\x0f\udc89\n'
These values are one in each iteration.
The code implemented is: folList = iec61850.IedConnection_getFileDirectory(con,'') direcEntry = iec61850.LinkedList_getNext(folList[0]) while(direcEntry != None): aux1 = direcEntry.data
I would like to know how could I convert this data to string.?
It seems that we are working on the same thing. I used your code and file-tool.c to make something that should work but I still have a problem:
rootdir = iec61850.IedConnection_getFileDirectory(con,'')
iec61850.LinkedList_printStringList(rootdir[0])
direcEntry = iec61850.LinkedList_create()
direcEntry = iec61850.LinkedList_getNext(rootdir[0])
while direcEntry:
#FileDirectoryEntry entry = (FileDirectoryEntry) direcEntry.data
print(iec61850.FileDirectoryEntry_getFileName(direcEntry.data))
direcEntry = iec61850.LinkedList_getNext(direcEntry)
The commented line is the one that should be translated to python (right now it is just c/p from C). I don't seem to be able to create FileDirectoryEntry because no such function is available in iec61850.py, and the FileDirectoryEntry_create(fileName, fileSize, lastModified) requres arguments that I can't give because they are what I want to get in the first place. Documentation says it's deprecated and will be removed from API.
Any ideas?
I couldn't solve the problem showed above, I finally had to use the C# library.
You could write to my mail pro_ele_pro@outlook.comq
It seems that we are working on the same thing. I used your code and file-tool.c to make something that should work but I still have a problem:
rootdir = iec61850.IedConnection_getFileDirectory(con,'') iec61850.LinkedList_printStringList(rootdir[0]) direcEntry = iec61850.LinkedList_create() direcEntry = iec61850.LinkedList_getNext(rootdir[0]) while direcEntry: #FileDirectoryEntry entry = (FileDirectoryEntry) direcEntry.data print(iec61850.FileDirectoryEntry_getFileName(direcEntry.data)) direcEntry = iec61850.LinkedList_getNext(direcEntry)
The commented line is the one that should be translated to python (right now it is just c/p from C). I don't seem to be able to create FileDirectoryEntry because no such function is available in iec61850.py, and the FileDirectoryEntry_create(fileName, fileSize, lastModified) requres arguments that I can't give because they are what I want to get in the first place. Documentation says it's deprecated and will be removed from API.
Any ideas?
Hello, I'm having the same trouble. I need to create a FileDirectoryEntry object but the is no class defined in the Python library. When I check if it is defined in the C library. It says it will be removed.
Have you been able to solve the issue?
typedef struct sFileDirectoryEntry* FileDirectoryEntry; /**
I modified C code from one of the examples to fit my needs and ran compiled .exe from Python.
Could you give me some details when you're available. I'm pretty new at this. Thank you.
To solve this probleme I added:
FileDirectoryEntry toFileDirectoryEntry(void *data){
return (FileDirectoryEntry) data;
}
and
FileDirectoryEntry toFileDirectoryEntry(void *);
in iec61850.i and then recompile the library
with this modification this python code is running:
[rootDirectory, error] = iec61850.IedConnection_getFileDirectory(con, "")
directoryEntry = iec61850.LinkedList_getNext(rootDirectory)
while directoryEntry:
entry = iec61850.toFileDirectoryEntry(directoryEntry.data)
file_name=iec61850.FileDirectoryEntry_getFileName(entry)
print(file_name)
directoryEntry = iec61850.LinkedList_getNext(directoryEntry)
How can I utilize the control operation with Python? Help me please
I've managed to build the lib for Python and now am using it to run a IEC 61850 server. However SWIG was not able to adopt the control model callback "typedef ControlHandlerResult" in order to utilize the corresponding IedServer_setControlHandler(). The way I see it, there are two options to convert the callback function / typedefs via SWIG:
How can I utilize the control operation with Python? Does anyone have a description on how to modify the interface file or the source code in order to utilize the control operation with Python?
Regards!