Open hanusek opened 3 years ago
I use the libiec6185 library in python. I did write quick fix:
def read_quality(var_name):
con = iec61850.IedConnection_create()
error = iec61850.IedConnection_connect(con, "127.0.0.1", 102)
if error != iec61850.IED_ERROR_OK:
iec61850.IedConnection_destroy(con)
assert False, "IEC-61850 connection failed!"
obj = iec61850.IedConnection_readObject(con, var_name, iec61850.IEC61850_FC_ST)
bs = ""
for i in range(2):
b = iec61850.MmsValue_getBitStringBit(obj[0], i)
bs = bs + str(int(b))
q = int(bs, 2)
iec61850.IedConnection_close(con)
iec61850.IedConnection_destroy(con)
return q
When I read the value from the server (value on server == 2 [Reserved]) then the client (python) reads the value == 1 [Invalid]
Code:
source: https://github.com/mz-automation/libiec61850/blob/8c1b75b382a7aa45918b850bf6f801de83cc0a4c/src/iec61850/inc/iec61850_common.h#L314
source: https://www.diva-portal.org/smash/get/diva2:1052501/FULLTEXT01.pdf (Table 4) https://libiec61850.com/csharp-api/namespace_i_e_c61850_1_1_common.html