C -> LIB61850_API SVControlBlock_getName added

.NET -> Wrapper for SVControl ge_name added, called inside of SMVHandler
v1.6
Maxson Ramon dos Anjos Medeiros 1 month ago
parent f2940775f6
commit 37a857e128

@ -26,6 +26,9 @@ namespace IEC61850
static extern IntPtr SVControlBlock_create(string name, IntPtr parent, string svID,string dataSet, UInt32 confRev, uint smpMod, static extern IntPtr SVControlBlock_create(string name, IntPtr parent, string svID,string dataSet, UInt32 confRev, uint smpMod,
UInt16 smpRate, uint optFlds, bool isUnicast); UInt16 smpRate, uint optFlds, bool isUnicast);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr SVControlBlock_getName(IntPtr self);
/// <summary> /// <summary>
/// create a new Multicast/Unicast Sampled Value (SV) control block (SvCB) /// create a new Multicast/Unicast Sampled Value (SV) control block (SvCB)
/// Create a new Sampled Value control block(SvCB) and add it to the given logical node(LN) /// Create a new Sampled Value control block(SvCB) and add it to the given logical node(LN)
@ -56,6 +59,14 @@ namespace IEC61850
this.self = self; this.self = self;
} }
public string Name
{
get
{
return Marshal.PtrToStringAnsi(SVControlBlock_getName(self));
}
}
} }
} }

@ -142,7 +142,7 @@ namespace server_access_control
/* Install handler to control access to control blocks (RCBs, LCBs, GoCBs, SVCBs, SGCBs)*/ /* Install handler to control access to control blocks (RCBs, LCBs, GoCBs, SVCBs, SGCBs)*/
bool ControlBlockAccessCallBack(object parameter, ClientConnection connection, ACSIClass acsiClass, LogicalDevice ld, LogicalNode ln, string objectName, string subObjectName, ControlBlockAccessType accessType) bool ControlBlockAccessCallBack(object parameter, ClientConnection connection, ACSIClass acsiClass, LogicalDevice ld, LogicalNode ln, string objectName, string subObjectName, ControlBlockAccessType accessType)
{ {
Console.WriteLine(acsiClass.ToString() + " "+ accessType.ToString() + " access " + ld.GetName() + ln.GetName() +"/"+ objectName + "." + subObjectName); Console.WriteLine(acsiClass.ToString() + " "+ accessType.ToString() + " access " + ld.GetName() + ln.GetName() +"/"+ objectName + "." + subObjectName + "\n");
return true; return true;
} }
@ -221,18 +221,6 @@ namespace server_access_control
iedServer.SetDirectoryAccessHandler(directoryAccessHandler, null); iedServer.SetDirectoryAccessHandler(directoryAccessHandler, null);
/* Handler for Sampled values control block
*/
void SVCBEventHandler(SVControlBlock svcb, SMVEvent smvEvent, object parameter)
{
Console.WriteLine("SVControlBlock event " + smvEvent.ToString());
}
//LogicalNode logicalNode = (LogicalNode)iedModel.GetModelNodeByShortObjectReference("GenericIO/GGIO1");
//SVControlBlock sampledValuesControlBlock = iedModel.GetSVControlBlock(logicalNode, "MSVCB01");
//iedServer.SetSVCBHandler(SVCBEventHandler, sampledValuesControlBlock, null);
/*SettingGroups*/ /*SettingGroups*/
LogicalDevice logicalDevice = (LogicalDevice)iedModel.GetModelNodeByShortObjectReference("GenericIO"); ; LogicalDevice logicalDevice = (LogicalDevice)iedModel.GetModelNodeByShortObjectReference("GenericIO"); ;
@ -338,7 +326,7 @@ namespace server_access_control
void sVCBEventHandler(SVControlBlock sampledValuesControlBlock, SMVEvent sMVEvent, object parameter) void sVCBEventHandler(SVControlBlock sampledValuesControlBlock, SMVEvent sMVEvent, object parameter)
{ {
Console.WriteLine("control called"); Console.WriteLine("control called " + sampledValuesControlBlock.Name + " Event: " + sMVEvent.ToString() + "\n");
} }
iedServer.SetSVCBHandler(sVCBEventHandler, sampledValuesControlBlock_1, null); iedServer.SetSVCBHandler(sVCBEventHandler, sampledValuesControlBlock_1, null);

@ -1,20 +1,5 @@
MODEL(simpleIO){ MODEL(simpleIO){
LD(GenericIO){ LD(GenericIO){
LN(LPHD1){
DO(PhyNam 0){
DA(vendor 0 20 5 16 0);
}
DO(PhyHealth 0){
DA(stVal 0 12 0 17 0)=1;
DA(q 0 23 0 18 0);
DA(t 0 22 0 16 0);
}
DO(Proxy 0){
DA(stVal 0 0 0 17 0);
DA(q 0 23 0 18 0);
DA(t 0 22 0 16 0);
}
}
LN(GGIO1){ LN(GGIO1){
DO(Mod 0){ DO(Mod 0){
DA(stVal 0 12 0 17 0)=1; DA(stVal 0 12 0 17 0)=1;
@ -159,6 +144,21 @@ DA(q 0 23 0 18 0);
DA(t 0 22 0 16 0); DA(t 0 22 0 16 0);
} }
} }
LN(LPHD1){
DO(PhyNam 0){
DA(vendor 0 20 5 16 0);
}
DO(PhyHealth 0){
DA(stVal 0 12 0 17 0)=1;
DA(q 0 23 0 18 0);
DA(t 0 22 0 16 0);
}
DO(Proxy 0){
DA(stVal 0 0 0 17 0);
DA(q 0 23 0 18 0);
DA(t 0 22 0 16 0);
}
}
LN(LLN0){ LN(LLN0){
SG(1 5) SG(1 5)
DO(Mod 0){ DO(Mod 0){
@ -234,7 +234,10 @@ LOG(EventLog);
GC(gcbEvents events Events 3 0 1000 3000){ GC(gcbEvents events Events 3 0 1000 3000){
PA(4 1 1000 010CCD010001); PA(4 1 1000 010CCD010001);
} }
SMVC(MSVCB01 xxxxMUnn01 Events 0 0 0 1 0 ){ SMVC(SMV1 xxxxMUnn01 Events 0 0 0 1 0 ){
PA(4 123 4000 010CCD040001);
}
SMVC(SMV2 null Measurements 0 0 0 0 0 ){
PA(4 123 4000 010CCD040001); PA(4 123 4000 010CCD040001);
} }
} }

@ -468,6 +468,9 @@ LIB61850_API SVControlBlock*
SVControlBlock_create(const char* name, LogicalNode* parent, const char* svID, const char* dataSet, uint32_t confRev, uint8_t smpMod, SVControlBlock_create(const char* name, LogicalNode* parent, const char* svID, const char* dataSet, uint32_t confRev, uint8_t smpMod,
uint16_t smpRate, uint8_t optFlds, bool isUnicast); uint16_t smpRate, uint8_t optFlds, bool isUnicast);
LIB61850_API const char*
SVControlBlock_getName(SVControlBlock* self);
LIB61850_API void LIB61850_API void
SVControlBlock_addPhyComAddress(SVControlBlock* self, PhyComAddress* phyComAddress); SVControlBlock_addPhyComAddress(SVControlBlock* self, PhyComAddress* phyComAddress);

@ -587,6 +587,13 @@ SVControlBlock_create(const char* name, LogicalNode* parent, const char* svID, c
return self; return self;
} }
const char*
SVControlBlock_getName(SVControlBlock* self)
{
return self->name;
}
void void
SVControlBlock_addPhyComAddress(SVControlBlock* self, PhyComAddress* phyComAddress) SVControlBlock_addPhyComAddress(SVControlBlock* self, PhyComAddress* phyComAddress)
{ {

Loading…
Cancel
Save