.
. 客户端程序参考example/iec61850_client_example1
. 服务器使用example/server_example3
数据定义参考simpleIO_sbo_control.icd文件;
客户端读取一个<LNodeType.DO>
使用函数IedConnection_readObject, 定义如下MmsValue* IedConnection_readObject(IedConnection self, IedClientError* error, char* objectReference, FunctionalConstraint fc);
1. objectReference构造规则为, (参考对应的icd文件) s1 = <IED name="111" s2 = <IED->AccessPoint->Server->LDecive inst="222" s3 = <DataTypeTemplates->LNodeType id="333" s4 = <DataTypeTemplates->LNodeType->DO name="444" type="???" 若type为struct, 则找到该struct定义处, 继续对其中某个项的引用 s5 = <DataTypeTemplates->DOType name="???"->DA name="555" 最终的引用路径为 "111222/333.444.555" 2. fc属性 enum eFunctionalConstraint 具体指定时, 应与icd文件中对象读取项所定义的fc属性一致, 否则读取会不正确;
3. 代码示例
. icd定义部分
<IED name="TEMPLATE" <AccessPoint <LDecive inst="LD1" <LN InClass="LCSM" InType="LCSM1"<DataTypeTemplates>
<LNodeType id="LCSM1" <DO name="HostTimeRef" type="INS_1_Alm" <DOType id="INS_1_Alm" <DA name="stVal" bType="INT32" fc="ST". coding
MmsValue *pv = IedConnection_readObject(con, &error, "TEMPLATELD1/LCSM1.HostTimeRef.stVal", ST); if(pv != NULL) { int32_t v = MmsValue_toInt32(pv); printf("read int32 value: %d, type=%d\n", v); MmsValue_delete(pv); } ...