mz-automation / libiec61850

Official repository for libIEC61850, the open-source library for the IEC 61850 protocols
http://libiec61850.com/libiec61850
GNU General Public License v3.0
857 stars 459 forks source link

Generate .cfg from a .cid with C++ ? #381

Open DonavanMartin opened 2 years ago

DonavanMartin commented 2 years ago

Hi,

Is it possible to generate a .cfg from a .cid without JAVA (genmodel.jar)? I looked in the tools folder and it seems that this feature is only available in JAVA but the libiec61850 server language is C++. The optimal way should be the generation of the .cfg directly from the iec61850 server.

Thanks

kevinjhang commented 2 years ago

I have C#. Actually, it's rewritten from Java.

donavan-tangible commented 1 year ago

Thanks for your reply @kevinjhang... Python or C should be a better option to make it compatible. Server don't necessary have C#, that's also the case with JAVA...

jameszxj commented 1 year ago

I create model directly from cid file use pugixml lib. So it is possible, you can do it from the JAVA

DonavanMartin commented 1 year ago

I know I can do it in JAVA... But JAVA and C# are only ~15% of the languages used in this repo. If you are running a server in C or C++ then you need to add all the JAVA logic just to convert a .cid to a .cfg file... Actually this ticket is related to an implementation issue.

Capture d’écran, le 2023-01-31 à 09 00 16
mzillgith commented 1 year ago

The idea of the cfg file is that you don't need a SCL/XML parser on the target system and also not having to download the SCL(CID) file to the target system running the IEC 61850 server. It's to save resources on the target system.

In the cases we use the cfg files we usually have a separate configuration tool (usually a .NET windows tool) to create the file.

When the device running the server has more resources it also makes sense to download the CID file directly to the device. For this the commercial version of libiec61850 has C code to read the CID file and generate the data model and configuration at runtime.

But I think it doesn't make so much sense to create the cfg at runtime using C code on the same system where the server runs.

DonavanMartin commented 1 year ago

I know the whole process of .cid and .cfg files... (static/dynamic model) The problem is that the languages used to convert the .cid file to .cfg file are only C# and JAVA... This is nonsense... The server code is written in C... Currently, it is absolutely necessary to install another language for a simple file conversion. At the end, the .cfg is used on a server written in C or maybe C# (I don't use C#).

It should be really simpler if the file converting process is a part of the server it self, by uploading a new .cid file.