输入事宜INIT与输入变量QI、ID管理,当INIT事宜触发时,运行时会操作变量QI和ID;
输入事宜RSP与输入变量QI关联,当RSP事宜触发时,运行时会操作变量QI;
输失事宜INITO与输出变量QO、STATUS关联,当INITO事宜触发时,运行时会操作变量QO、STATUS;
输失事宜IND与输出变量QO、STATUS、RD_1关联,当IND事宜触发时,运行时会操作变量QO、STATUS、RD_1;
功能块接口在forte的存储构造如下:
struct SFBInterfaceSpec {
TForteUInt8 m_nNumEIs; //表示输入事宜数量
const CStringDictionary::TStringId m_aunEINames; //表示输入事宜名称
const TDataIOID m_anEIWith;//表示输入事宜与输入变量关联的数组
const TForteInt16 m_anEIWithIndexes; //表示输入事宜下标与m_anEIWith关联关系
TForteUInt8 m_nNumEOs; //表示输失事宜个数
const CStringDictionary::TStringId m_aunEONames;//表示输失事宜名称
const TDataIOID m_anEOWith;//表示输失事宜与输出变量关联的数组
const TForteInt16 m_anEOWithIndexes;//表示输失事宜下标与m_anEOWith关联关系
TForteUInt8 m_nNumDIs;//表示输入数据个数
const CStringDictionary::TStringId m_aunDINames;//表示输入数据名称数组
const CStringDictionary::TStringId m_aunDIDataTypeNames;//表示输入数据类型数组
TForteUInt8 m_nNumDOs; //表示输出数据个数
const CStringDictionary::TStringId m_aunDONames; /表示输出数据名称数组
const CStringDictionary::TStringId m_aunDODataTypeNames; //表示输出数据类型数组
TForteUInt8 m_nNumAdapters; //适配器个数,即61499里的插头、插座数据类型
const SAdapterInstanceDef m_pstAdapterInstanceDefinition;//适配器描述模型
};
在运行时SFBInterfaceSpec对应存储的数据如下:
m_nNumEIs=2;
m_aunEINames={ g_nStringIdINIT, g_nStringIdRSP};
m_anEIWith={0,1,255,0,255};
m_anEIWithIndexes={0,3};
m_nNumEOs=2;
m_aunEONames={g_nStringIdINITO, g_nStringIdIND};
m_anEOWith={0,1,255,0,1,2,255};
m_anEOWithIndexes={0,3};//0表示第一个事宜对应m_anEOWith里的第一个值0,3表示第二个事宜对应m_anEOWith里的第4个值0
m_nNumDIs=2;
m_aunDINames={g_nStringIdQI, g_nStringIdID};
m_aunDIDataTypeNames={g_nStringIdBOOL, g_nStringIdWSTRING};
m_nNumDOs=2;
m_aunDONames={g_nStringIdQO, g_nStringIdSTATUS, g_nStringIdRD_1};
m_aunDODataTypeNames={g_nStringIdBOOL, g_nStringIdWSTRING, g_nStringIdANY};
m_nNumAdapters=0;
m_pstAdapterInstanceDefinition=0;