Merge remote-tracking branch 'refs/remotes/mz-automation/master'

pull/44/head
Jarkko Peltonen 8 years ago
commit 4fb8abe750

@ -0,0 +1,25 @@
language: c
compiler:
- clang
- gcc
addons:
apt:
packages:
- cmake
- swig
- libsqlite3-dev
- python-dev
before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then
brew update;
brew install swig python sqlite;
fi
- mkdir -p build && cd build
script:
- cmake .. -DBUILD_PYTHON_BINDINGS=ON
- make
- make test

@ -1,3 +1,57 @@
Changes to version 1.1.1
------------------------
- IEC 61850 client: fixed bug in APC control handling
- IEC 61850 client: ClientReportControlBlock now accepts "$" and "." as seperator for RCB object reference
- MMS client: fixed bug in MmsConnection_connect (COTP payload buffer was not reset in case of an error during connect -> connection failed in case of reuse of MmsConnection object
- MMS client: delete named variable list service supports VMD specific lists
- SV subscriber/publisher: additional features and bug fixes
- SV: fixed data type for smpRate
- SV: fixed encoding of optional smpMod attribute
- SV receiver: Added semaphore to make subscriber list thread-safe
- .NET API: ControlObject implements IDisposable interface
- IED server: added new function IedServer_udpateDbposValue
- fixed problem with cmake include folders
- MMS client: file services -fixed encoding problem with long file names
- MMS server: ACSE authenticator passes application reference (ap-title and ae-qualifier)
- example directory cleanup
- MMS: fixed potential memory leak in asn1 code that can be caused by malformed MMS messages
- MMS client: MmsConnection_getVariableAccessAttributes support for VMD specific variables
- Java SCL parser: added support for "Val" elements for Octet64 types
Changes to version 1.1.0
------------------------
- MMS client/server: added write support for named variable lists
- IEC 61850 client/server: added support for SetDataSet service
- C# API: client - added support to write data set values
- IEC 61850 client: Changed result strings of IedConnection_getDataDirectoryByFC. Removed appended FC string.
- MMS client/server: extended BER encoder to support MMS PDU sizes with more than 64k
- C# API: server - keep references to internal control handler delegates to avoid garbage collection
- IEC 61850 server: added IedModel_getDeviceByInst function
- SV subscriber: added subscriber side handling for RefrTm
- SV publisher: Changed SampledValuesPublisher_create to support setting of Communication parameters at runtime
- socket-win32: updated WSA initialization handling
- all: small fixes and code optimizations
Changes to version 1.0.2
------------------------
- server: added MmsFileAccessHandler for server side monitoring and control of file services
- file services: added support to set filestore basepath at runtime
- added IedConnection_getFileDirectoryEx to better control receiving file directories
- common: added timestamp handling functions Timestamp_create, Timestamp_destroy, Timestamp_setByMmsUtcTime, Timestamp_toMmsValue
- .NET API: Added Timestamp class
- .NET API: Added missing UpdateAttribute methods to IedServer
- common: added support for Currency BasicType
- MMS file services: fixed problem with negative frsmId
- java scl tools: fixed bug with SDOs in dynamic code generator
- java scl tools: fixed parsing bug in OptionFields.java
- server: added functions to restrict local IP address IedServer_setLocalIpAddress, IedServer.SetLocalIpAddress
- .NET: IedConnection: added internal reference to IsoConnectionParameters object to avoid deletion of internal AcseAuthenticationParameters by garbage collector
Changes to version 1.0.1
------------------------
- server: fixed problem in COTP src/dst reference handling (returning zero src reference)

@ -2,17 +2,17 @@ cmake_minimum_required(VERSION 2.8)
# automagically detect if we should cross-compile
if(DEFINED ENV{TOOLCHAIN})
set(CMAKE_C_COMPILER $ENV{TOOLCHAIN}gcc)
set(CMAKE_CXX_COMPILER $ENV{TOOLCHAIN}g++)
set(CMAKE_AR "$ENV{TOOLCHAIN}ar" CACHE FILEPATH "CW archiver" FORCE)
set(CMAKE_C_COMPILER $ENV{TOOLCHAIN}gcc)
set(CMAKE_CXX_COMPILER $ENV{TOOLCHAIN}g++)
set(CMAKE_AR "$ENV{TOOLCHAIN}ar" CACHE FILEPATH "CW archiver" FORCE)
endif()
project(libiec61850)
ENABLE_TESTING()
set(LIB_VERSION_MAJOR "1")
set(LIB_VERSION_MINOR "0")
set(LIB_VERSION_PATCH "2")
set(LIB_VERSION_MINOR "1")
set(LIB_VERSION_PATCH "1")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/third_party/cmake/modules/")
@ -32,20 +32,15 @@ option(BUILD_PYTHON_BINDINGS "Build Python bindings" OFF)
option(CONFIG_MMS_SINGLE_THREADED "Compile for single threaded version" ON)
option(CONFIG_MMS_THREADLESS_STACK "Optimize stack for threadless operation (warning: single- or multi-threaded server will not work!)" OFF)
# choose the library features which shall be included
option(CONFIG_ACTIVATE_TCP_KEEPALIVE "Activate TCP keepalive" ON)
option(CONFIG_INCLUDE_GOOSE_SUPPORT "Build with GOOSE support" ON)
# choose the library features which shall be included
option(CONFIG_IEC61850_CONTROL_SERVICE "Build with support for IEC 61850 control features" ON)
option(CONFIG_IEC61850_REPORT_SERVICE "Build with support for IEC 61850 reporting services" ON)
option(CONFIG_IEC61850_LOG_SERVICE "Build with support for IEC 61850 logging services" ON)
option(CONFIG_IEC61850_SETTING_GROUPS "Build with support for IEC 61850 setting group services" ON)
option(CONFIG_ACTIVATE_TCP_KEEPALIVE "Activate TCP keepalive" ON)
set(CONFIG_REPORTING_DEFAULT_REPORT_BUFFER_SIZE "8000" CACHE STRING "Default buffer size for buffered reports in byte" )
# advanced options
@ -62,17 +57,17 @@ option(DEBUG_MMS_CLIENT "Enable MMS CLIENT printf debugging" OFF)
# DEBUG_IED_CLIENT DEBUG_MMS_SERVER DEBUG_MMS_CLIENT)
include_directories(
${CMAKE_CURRENT_LIST_DIR}/config
${CMAKE_CURRENT_LIST_DIR}/src/common/inc
${CMAKE_CURRENT_LIST_DIR}/src/goose
${CMAKE_CURRENT_LIST_DIR}/src/sampled_values
${CMAKE_CURRENT_LIST_DIR}/src/hal/inc
${CMAKE_CURRENT_LIST_DIR}/src/iec61850/inc
${CMAKE_CURRENT_LIST_DIR}/src/iec61850/inc_private
${CMAKE_CURRENT_LIST_DIR}/src/mms/inc
${CMAKE_CURRENT_LIST_DIR}/src/mms/inc_private
${CMAKE_CURRENT_LIST_DIR}/src/mms/iso_mms/asn1c
${CMAKE_CURRENT_LIST_DIR}/src/logging
${CMAKE_CURRENT_BINARY_DIR}/config
src/common/inc
src/goose
src/sampled_values
src/hal/inc
src/iec61850/inc
src/iec61850/inc_private
src/mms/inc
src/mms/inc_private
src/mms/iso_mms/asn1c
src/logging
)
set(API_HEADERS
@ -114,42 +109,45 @@ set(API_HEADERS
${CMAKE_CURRENT_BINARY_DIR}/config/stack_config.h
)
IF(MSVC)
include_directories(
src/vs
)
ENDIF(MSVC)
if(MSVC)
include_directories(
src/vs
)
endif(MSVC)
# write the detected stuff to this file
configure_file(${CMAKE_CURRENT_LIST_DIR}/config/stack_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config/stack_config.h)
configure_file(
${CMAKE_CURRENT_LIST_DIR}/config/stack_config.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config/stack_config.h
)
if(BUILD_EXAMPLES)
add_subdirectory(examples)
add_subdirectory(examples)
endif(BUILD_EXAMPLES)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/src)
INSTALL(FILES ${API_HEADERS} DESTINATION include/libiec61850 COMPONENT Development)
IF(BUILD_PYTHON_BINDINGS)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/pyiec61850)
ENDIF(BUILD_PYTHON_BINDINGS)
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
INCLUDE(InstallRequiredSystemLibraries)
SET(CPACK_PACKAGE_DESCRIPTION "IEC 61850 MMS/GOOSE client and server library")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IEC 61850 MMS/GOOSE client and server library")
SET(CPACK_PACKAGE_VENDOR "MZ Automation GmbH")
SET(CPACK_PACKAGE_CONTACT "info@libiec61850.com")
SET(CPACK_PACKAGE_VERSION_MAJOR "${LIB_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${LIB_VERSION_MINOR}")
SET(CPACK_PACKAGE_VERSION_PATCH "${LIB_VERSION_PATCH}")
SET(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${CMAKE_SYSTEM_PROCESSOR}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
SET(CPACK_COMPONENTS_ALL Libraries Development Applications)
#set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}")
INCLUDE(CPack)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
install(FILES ${API_HEADERS} DESTINATION include/libiec61850 COMPONENT Development)
if(BUILD_PYTHON_BINDINGS)
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/pyiec61850)
endif(BUILD_PYTHON_BINDINGS)
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_DESCRIPTION "IEC 61850 MMS/GOOSE client and server library")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IEC 61850 MMS/GOOSE client and server library")
set(CPACK_PACKAGE_VENDOR "MZ Automation GmbH")
set(CPACK_PACKAGE_CONTACT "info@libiec61850.com")
set(CPACK_PACKAGE_VERSION_MAJOR "${LIB_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${LIB_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${LIB_VERSION_PATCH}")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}_${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}_${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_COMPONENTS_ALL Libraries Development Applications)
#set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}")
include(CPack)
endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")

@ -1,5 +1,7 @@
# README libIEC61850
[![Build Status](https://travis-ci.org/mz-automation/libiec61850.svg?branch=master)](https://travis-ci.org/mz-automation/libiec61850)
This file is part of the documentation of **libIEC61850**. More documentation can be found online at http://libiec61850.com or in the provided doxygen documentation. Also consider to review the examples to understand how to use the library
Content:
@ -73,15 +75,17 @@ To build the library and run libiec61850 applications with GOOSE support on Wind
## Building with the cmake build script
With the help of the cmake build script it is possible to create platform independet project descriptions and let cmake create specific project or build files for other tools like Make or Visual Studio.
With the help of the cmake build script it is possible to create platform independent project descriptions and let cmake create specific project or build files for other tools like Make or Visual Studio.
If you have cmake installed fire up a command line (cmd.exe) and create a new subdirectory in the libiec61850 folder. Change to this subdirectory. Then you can invoke cmake. As an command line argument you have to supply a "generator" that is used by cmake to create the project file for the actual build tool (in our case Visual Studio 2015).
If you have cmake installed fire up a command line (cmd.exe) and create a new subdirectory in the libiec61850 folder. Change to this subdirectory. Then you can invoke cmake. As an command line argument you have to supply a "generator" that is used by cmake to create the project file for the actual build tool (in our case Visual Studio).
`cmake -G "Visual Studio 14 2015" ..`
`cmake -G "Visual Studio 11" ..`
will instruct cmake to create a "solution" for Visual Studio 2015. The resulting project files will be 32 bit.
will instruct cmake to create a "solution" for Visual Studio 2012. To do the same thing for Visual Studio 2010 type
To build 64 bit libraries the "Win64" generator option has to be added.
`cmake -G "Visual Studio 10" ..`
`cmake -G "Visual Studio 14 2015 Win64" ..`
Note: The ".." at the end of the command line tells cmake where to find the main build script file (called CMakeLists.txt). This should point to the folder libiec61850 which is in our case the parent directory (..).

@ -37,7 +37,7 @@
* 0 ==> server runs in multi-threaded mode (one thread for each connection and
* one server background thread )
*/
#define CONFIG_MMS_SINGLE_THREADED 0
#define CONFIG_MMS_SINGLE_THREADED 1
/*
* Optimize stack for threadless operation - don't use semaphores
@ -224,4 +224,9 @@
/* Support user access to raw messages */
#define CONFIG_MMS_RAW_MESSAGE_LOGGING 1
/* Allow to set the virtual filestore basepath for MMS file services at runtime with the
* MmsServer_setFilestoreBasepath function
*/
#define CONFIG_SET_FILESTORE_BASEPATH_AT_RUNTIME 1
#endif /* STACK_CONFIG_H_ */

@ -29,6 +29,9 @@
#cmakedefine01 DEBUG_MMS_SERVER
#cmakedefine01 DEBUG_GOOSE_SUBSCRIBER
#cmakedefine01 DEBUG_GOOSE_PUBLISHER
#cmakedefine01 DEBUG_SV_SUBSCRIBER
#cmakedefine01 DEBUG_SV_PUBLISHER
#cmakedefine01 DEBUG_HAL_ETHERNET
/* 1 ==> server runs in single threaded mode (one dedicated thread for the server)
* 0 ==> server runs in multi threaded mode (one thread for each connection and
@ -103,14 +106,14 @@
#define CONFIG_GOOSE_EVENT_RETRANSMISSION_COUNT 2
/* Define if GOOSE control block elements are writable (1) or read-only (0) */
#define CONFIG_GOOSE_GOID_WRITABLE 1
#define CONFIG_GOOSE_DATSET_WRITABLE 1
#define CONFIG_GOOSE_CONFREV_WRITABLE 1
#define CONFIG_GOOSE_NDSCOM_WRITABLE 1
#define CONFIG_GOOSE_DSTADDRESS_WRITABLE 1
#define CONFIG_GOOSE_MINTIME_WRITABLE 1
#define CONFIG_GOOSE_MAXTIME_WRITABLE 1
#define CONFIG_GOOSE_FIXEDOFFS_WRITABLE 1
#define CONFIG_GOOSE_GOID_WRITABLE 0
#define CONFIG_GOOSE_DATSET_WRITABLE 0
#define CONFIG_GOOSE_CONFREV_WRITABLE 0
#define CONFIG_GOOSE_NDSCOM_WRITABLE 0
#define CONFIG_GOOSE_DSTADDRESS_WRITABLE 0
#define CONFIG_GOOSE_MINTIME_WRITABLE 0
#define CONFIG_GOOSE_MAXTIME_WRITABLE 0
#define CONFIG_GOOSE_FIXEDOFFS_WRITABLE 0
/* The default value for the priority field of the 802.1Q header (allowed range 0-7) */
#define CONFIG_GOOSE_DEFAULT_PRIORITY 4
@ -133,6 +136,9 @@
/* include support for IEC 61850 reporting services */
#cmakedefine01 CONFIG_IEC61850_REPORT_SERVICE
/* support buffered report control blocks with ResvTms field */
#define CONFIG_IEC61850_BRCB_WITH_RESVTMS 0
/* The default buffer size of buffered RCBs in bytes */
#cmakedefine CONFIG_REPORTING_DEFAULT_REPORT_BUFFER_SIZE @CONFIG_REPORTING_DEFAULT_REPORT_BUFFER_SIZE@
@ -194,10 +200,21 @@
#define CONFIG_IEC61850_CONTROL_SERVICE 0
#endif
/* Sort getNameList response according to the MMS specified collation order - this is required by the standard
* Set to 0 only for performance reasons and when no certification is required! */
#define CONFIG_MMS_SORT_NAME_LIST 1
#define CONFIG_INCLUDE_PLATFORM_SPECIFIC_HEADERS 0
/* use short FC defines as in old API */
#define CONFIG_PROVIDE_OLD_FC_DEFINES 0
/* Support user acccess to raw messages */
#cmakedefine01 CONFIG_MMS_RAW_MESSAGE_LOGGING
/* Allow to set the virtual filestore basepath for MMS file services at runtime with the
* MmsServer_setFilestoreBasepath function
*/
#define CONFIG_SET_FILESTORE_BASEPATH_AT_RUNTIME 1
#endif /* STACK_CONFIG_H_ */

@ -104,7 +104,7 @@ namespace IEC61850
/// <summary>
/// Control object.
/// </summary>
public class ControlObject
public class ControlObject : IDisposable
{
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
private static extern LastApplErrorInternal ControlObjectClient_getLastApplError(IntPtr self);
@ -183,12 +183,6 @@ namespace IEC61850
ControlObjectClient_setCommandTerminationHandler(controlObject, intCommandTerminationHandler, controlObject);
}
~ControlObject ()
{
if (this.controlObject != System.IntPtr.Zero)
ControlObjectClient_destroy(controlObject);
}
/// <summary>
/// Gets the control model.
/// </summary>
@ -443,6 +437,18 @@ namespace IEC61850
this.commandTerminationHandlerParameter = parameter;
}
protected virtual void Dispose(bool disposing) {
if (this.controlObject != System.IntPtr.Zero) {
ControlObjectClient_destroy (controlObject);
this.controlObject = System.IntPtr.Zero;
}
}
public void Dispose() {
Dispose (true);
}
}
}

@ -335,6 +335,9 @@ namespace IEC61850
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr IedConnection_readDataSetValues (IntPtr self, out int error, [MarshalAs(UnmanagedType.LPStr)] string dataSetReference, IntPtr dataSet);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void IedConnection_writeDataSetValues (IntPtr self, out int error, [MarshalAs(UnmanagedType.LPStr)] string dataSetReference, IntPtr values, out IntPtr accessResults);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern IntPtr IedConnection_createDataSet (IntPtr self, out int error, [MarshalAs(UnmanagedType.LPStr)] string dataSetReference, IntPtr dataSet);
@ -823,7 +826,7 @@ namespace IEC61850
return QueryLogByTime (logRef, startTimeMs, stopTimeMs, out moreFollows);
}
/// <summary>Read the variable specification (type description of a DA or FDCO</summary>
/// <summary>Read the variable specification (type description of a DA or FCDO</summary>
/// <param name="objectReference">The object reference of a DA or FCDO.</param>
/// <param name="fc">The functional constraint (FC) of the object</param>
/// <exception cref="IedConnectionException">This exception is thrown if there is a connection or service error</exception>
@ -1241,6 +1244,56 @@ namespace IEC61850
return dataSet;
}
/// <summary>
/// Writes the values of a data set (SetDataSetValues service).
/// </summary>
/// <returns>The list of access results</returns>
/// <param name="dataSetReference">The object reference of the data set</param>
/// <param name="values">The new values for the data set members. The values have to be of the same number and type as the data set members</param>
public List<MmsDataAccessError> WriteDataSetValues(string dataSetReference, List<MmsValue> values)
{
int error;
IntPtr accessResults = IntPtr.Zero;
IntPtr valueList = LinkedList_create ();
foreach (MmsValue mmsValue in values) {
LinkedList_add (valueList, mmsValue.valueReference);
}
IedConnection_writeDataSetValues (connection, out error, dataSetReference, valueList, out accessResults);
LinkedList_destroyStatic (valueList);
/* handle access results */
List<MmsDataAccessError> accessResultList = null;
if (accessResults != IntPtr.Zero) {
IntPtr element = LinkedList_getNext (accessResults);
while (element != IntPtr.Zero) {
IntPtr elementData = LinkedList_getData (element);
MmsValue accessResultValue = new MmsValue (elementData, true);
MmsDataAccessError dataAccessError = accessResultValue.GetDataAccessError ();
accessResultList.Add (dataAccessError);
element = LinkedList_getNext (element);
}
LinkedList_destroyStatic (accessResults);
}
if (error != 0)
throw new IedConnectionException ("Writing data set failed", error);
return accessResultList;
}
/// <summary>
/// Create a new data set.
/// </summary>

@ -561,6 +561,9 @@ namespace IEC61850
[DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)]
static extern IntPtr IedServer_create(IntPtr modelRef);
[DllImport("iec61850", CallingConvention = CallingConvention.Cdecl)]
static extern void IedServer_setLocalIpAddress(IntPtr self, string localIpAddress);
[DllImport ("iec61850", CallingConvention=CallingConvention.Cdecl)]
static extern void IedServer_start(IntPtr self, int tcpPort);
@ -656,7 +659,9 @@ namespace IEC61850
private IntPtr self = IntPtr.Zero;
private InternalControlHandler internalControlHandlerRef = null;
private InternalControlPerformCheckHandler internalControlPerformCheckHandlerRef = null;
private InternalControlWaitForExecutionHandler internalControlWaitForExecutionHandlerRef = null;
private class ControlHandlerInfo {
public DataObject controlObject = null;
@ -796,7 +801,28 @@ namespace IEC61850
private InternalConnectionHandler internalConnectionHandler = null;
/// <summary>
/// Sets the local ip address for listening
/// </summary>
/// <param name="localIpAddress">Local IP address.</param>
public void SetLocalIpAddress(string localIpAddress)
{
IedServer_setLocalIpAddress (self, localIpAddress);
}
/// <summary>
/// Start MMS server
/// </summary>
/// <param name="localIpAddress">Local IP address.</param>
/// <param name="tcpPort">TCP port to use</param>
public void Start(string localIpAddress, int tcpPort)
{
SetLocalIpAddress (localIpAddress);
Start (tcpPort);
}
/// <summary>Start MMS server</summary>
/// <param name="tcpPort">TCP port to use</param>
public void Start(int tcpPort)
{
if (internalConnectionHandler == null)
@ -860,7 +886,10 @@ namespace IEC61850
info.controlHandler = handler;
info.controlHandlerParameter = parameter;
IedServer_setControlHandler(self, controlObject.self, internalControlHandler, GCHandle.ToIntPtr(info.handle));
if (internalControlHandlerRef == null)
internalControlHandlerRef = new InternalControlHandler (internalControlHandler);
IedServer_setControlHandler(self, controlObject.self, internalControlHandlerRef, GCHandle.ToIntPtr(info.handle));
}
public void SetCheckHandler (DataObject controlObject, CheckHandler handler, object parameter)
@ -870,7 +899,10 @@ namespace IEC61850
info.checkHandler = handler;
info.checkHandlerParameter = parameter;
IedServer_setPerformCheckHandler(self, controlObject.self, internalCheckHandler, GCHandle.ToIntPtr(info.handle));
if (internalControlPerformCheckHandlerRef == null)
internalControlPerformCheckHandlerRef = new InternalControlPerformCheckHandler (internalCheckHandler);
IedServer_setPerformCheckHandler(self, controlObject.self, internalControlPerformCheckHandlerRef, GCHandle.ToIntPtr(info.handle));
}
public void SetWaitForExecutionHandler (DataObject controlObject, ControlWaitForExecutionHandler handler, object parameter)
@ -880,7 +912,10 @@ namespace IEC61850
info.waitForExecHandler = handler;
info.waitForExecHandlerParameter = parameter;
IedServer_setWaitForExecutionHandler(self, controlObject.self, internalControlWaitForExecutionHandler, GCHandle.ToIntPtr(info.handle));
if (internalControlWaitForExecutionHandlerRef == null)
internalControlWaitForExecutionHandlerRef = new InternalControlWaitForExecutionHandler (internalControlWaitForExecutionHandler);
IedServer_setWaitForExecutionHandler(self, controlObject.self, internalControlWaitForExecutionHandlerRef, GCHandle.ToIntPtr(info.handle));
}
public void HandleWriteAccess (DataAttribute dataAttr, WriteAccessHandler handler, object parameter)

@ -86,7 +86,10 @@ namespace control
Thread.Sleep(1000);
}
con.Abort();
// has to be called before IedConnection dispose method!
control.Dispose();
con.Abort();
}
catch (IedConnectionException e)
{

@ -1,8 +1,7 @@
add_subdirectory(server_example1)
add_subdirectory(server_example2)
add_subdirectory(server_example3)
add_subdirectory(server_example4)
add_subdirectory(server_example5)
add_subdirectory(server_example_simple)
add_subdirectory(server_example_basic_io)
add_subdirectory(server_example_password_auth)
add_subdirectory(server_example_write_handler)
add_subdirectory(server_example_control)
add_subdirectory(server_example_dynamic)
add_subdirectory(server_example_config_file)
@ -11,36 +10,35 @@ add_subdirectory(server_example_threadless)
add_subdirectory(server_example_61400_25)
add_subdirectory(server_example_setting_groups)
add_subdirectory(server_example_logging)
add_subdirectory(server_example_files)
add_subdirectory(iec61850_client_example1)
add_subdirectory(iec61850_client_example2)
add_subdirectory(iec61850_client_example3)
add_subdirectory(iec61850_client_example4)
add_subdirectory(iec61850_client_example5)
add_subdirectory(iec61850_client_example_files)
add_subdirectory(iec61850_client_example_reporting)
add_subdirectory(iec61850_client_example_log)
add_subdirectory(mms_client_example1)
add_subdirectory(mms_client_example2)
add_subdirectory(mms_client_example3)
add_subdirectory(mms_client_example4)
IF(WIN32)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Lib/wpcap.lib")
message("Found winpcap -> compile examples for GOOSE and SV")
add_subdirectory(server_example_goose)
add_subdirectory(goose_subscriber)
add_subdirectory(goose_publisher)
add_subdirectory(sv_subscriber)
add_subdirectory(iec61850_9_2_LE_example)
add_subdirectory(iec61850_sv_client_example)
add_subdirectory(sv_publisher)
if(NOT WIN32)
add_subdirectory(iec61850_client_example_files)
endif()
if(WIN32)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../third_party/winpcap/Lib/wpcap.lib")
set(BUILD_SV_GOOSE_EXAMPLES ON)
message("Found winpcap -> compile examples for GOOSE and SV")
endif()
else()
add_subdirectory(server_example_goose)
add_subdirectory(goose_subscriber)
add_subdirectory(goose_publisher)
add_subdirectory(sv_subscriber)
add_subdirectory(iec61850_9_2_LE_example)
add_subdirectory(iec61850_sv_client_example)
add_subdirectory(sv_publisher)
set(BUILD_SV_GOOSE_EXAMPLES ON)
endif()
if(${BUILD_SV_GOOSE_EXAMPLES})
add_subdirectory(server_example_goose)
add_subdirectory(goose_subscriber)
add_subdirectory(goose_publisher)
add_subdirectory(sv_subscriber)
add_subdirectory(iec61850_9_2_LE_example)
add_subdirectory(iec61850_sv_client_example)
add_subdirectory(sv_publisher)
endif()

@ -1,21 +1,15 @@
EXAMPLE_DIRS = mms_client_example1
EXAMPLE_DIRS += mms_client_example2
EXAMPLE_DIRS += mms_client_example3
EXAMPLE_DIRS += mms_client_example4
EXAMPLE_DIRS += mms_client_example5
EXAMPLE_DIRS += iec61850_client_example1
EXAMPLE_DIRS = iec61850_client_example1
EXAMPLE_DIRS += iec61850_client_example2
EXAMPLE_DIRS += iec61850_client_example3
EXAMPLE_DIRS += iec61850_client_example4
EXAMPLE_DIRS += iec61850_client_example5
EXAMPLE_DIRS += iec61850_client_example_reporting
EXAMPLE_DIRS += iec61850_client_example_log
EXAMPLE_DIRS += server_example1
EXAMPLE_DIRS += server_example2
EXAMPLE_DIRS += server_example3
EXAMPLE_DIRS += server_example4
EXAMPLE_DIRS += server_example5
EXAMPLE_DIRS += server_example_simple
EXAMPLE_DIRS += server_example_basic_io
EXAMPLE_DIRS += server_example_password_auth
EXAMPLE_DIRS += server_example_write_handler
EXAMPLE_DIRS += server_example_goose
EXAMPLE_DIRS += server_example_control
EXAMPLE_DIRS += server_example_config_file
@ -25,6 +19,7 @@ EXAMPLE_DIRS += server_example_61400_25
EXAMPLE_DIRS += server_example_threadless
EXAMPLE_DIRS += server_example_setting_groups
EXAMPLE_DIRS += server_example_logging
EXAMPLE_DIRS += server_example_files
EXAMPLE_DIRS += goose_subscriber
EXAMPLE_DIRS += goose_publisher
EXAMPLE_DIRS += sv_subscriber
@ -34,11 +29,10 @@ EXAMPLE_DIRS += iec61850_sv_client_example
EXAMPLE_DIRS += sv_publisher
EXAMPLE_DIRS += sv_subscriber
MODEL_DIRS += server_example1
MODEL_DIRS += server_example2
MODEL_DIRS += server_example3
MODEL_DIRS += server_example4
MODEL_DIRS += server_example5
MODEL_DIRS += server_example_simple
MODEL_DIRS += server_example_basic_io
MODEL_DIRS += server_example_password_auth
MODEL_DIRS += server_example_write_handler
MODEL_DIRS += server_example_goose
MODEL_DIRS += server_example_control
MODEL_DIRS += server_example_config_file
@ -47,6 +41,7 @@ MODEL_DIRS += server_example_61400_25
MODEL_DIRS += server_example_threadless
MODEL_DIRS += server_example_setting_groups
MODEL_DIRS += server_example_logging
MODEL_DIRS += server_example_files
MODEL_DIRS += iec61850_9_2_LE_example
all: examples

@ -12,8 +12,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#define __STDC_FORMAT_MACROS /* otherwise PRIu64 is not defined for MinGW */
#include <inttypes.h>
static int running = 1;
@ -29,9 +27,10 @@ gooseListener(GooseSubscriber subscriber, void* parameter)
printf(" stNum: %u sqNum: %u\n", GooseSubscriber_getStNum(subscriber),
GooseSubscriber_getSqNum(subscriber));
printf(" timeToLive: %u\n", GooseSubscriber_getTimeAllowedToLive(subscriber));
#ifndef _WIN32
printf(" timestamp: %"PRIu64"\n", GooseSubscriber_getTimestamp(subscriber));
#endif
uint64_t timestamp = GooseSubscriber_getTimestamp(subscriber);
printf(" timestamp: %u.%u\n", (uint32_t) (timestamp / 1000), (uint32_t) (timestamp % 1000));
MmsValue* values = GooseSubscriber_getDataSetValues(subscriber);
@ -45,14 +44,6 @@ gooseListener(GooseSubscriber subscriber, void* parameter)
int
main(int argc, char** argv)
{
MmsValue* dataSetValues = MmsValue_createEmptyArray(4);
int i;
for (i = 0; i < 4; i++) {
MmsValue* dataSetEntry = MmsValue_newBoolean(false);
MmsValue_setElement(dataSetValues, i, dataSetEntry);
}
GooseReceiver receiver = GooseReceiver_create();
if (argc > 1) {
@ -80,5 +71,7 @@ main(int argc, char** argv)
Thread_sleep(100);
}
GooseSubscriber_destroy(subscriber);
GooseReceiver_stop(receiver);
GooseReceiver_destroy(receiver);
}

@ -0,0 +1,9 @@
The default ethernet interface is eth0. You can specify another interface at the command line.
./sv_9_2LE_example eth1
In order for the SV publisher to start the SVCB has to be enabled by an MMS client.

@ -36,7 +36,7 @@
extern IedModel iedModel;
static int running = 0;
static int svcbEnabled = 0;
static int svcbEnabled = 1;
void sigint_handler(int signalId)
{
@ -57,9 +57,9 @@ static SampledValuesPublisher svPublisher;
static SV_ASDU asdu;
static void
setupSVPublisher()
setupSVPublisher(const char* svInterface)
{
svPublisher = SampledValuesPublisher_create("eth1");
svPublisher = SampledValuesPublisher_create(NULL, svInterface);
asdu = SampledValuesPublisher_addASDU(svPublisher, "xxxxMUnn01", NULL, 1);
@ -87,6 +87,13 @@ static void sVCBEventHandler (SVControlBlock* svcb, int event, void* parameter)
int
main(int argc, char** argv)
{
char* svInterface;
if (argc > 1)
svInterface = argv[1];
else
svInterface = "eth0";
IedServer iedServer = IedServer_create(&iedModel);
/* MMS server will be instructed to start listening to client connections. */
@ -102,7 +109,7 @@ main(int argc, char** argv)
signal(SIGINT, sigint_handler);
setupSVPublisher();
setupSVPublisher(svInterface);
int voltage = 1;
int current = 1;

@ -50,6 +50,8 @@ int main(int argc, char** argv) {
if (error == IED_ERROR_OK) {
IedConnection_getServerDirectory(con, &error, false);
/* read an analog measurement value from server */
MmsValue* value = IedConnection_readObject(con, &error, "simpleIOGenericIO/GGIO1.AnIn1.mag.f", IEC61850_FC_MX);

@ -1,6 +1,6 @@
set(iec61850_client_example_files_SRCS
client_example_files.c
file-tool.c
)
IF(MSVC)
@ -8,10 +8,10 @@ set_source_files_properties(${iec61850_client_example_files_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(MSVC)
add_executable(iec61850_client_example_files
add_executable(file-tool
${iec61850_client_example_files_SRCS}
)
target_link_libraries(iec61850_client_example_files
target_link_libraries(file-tool
iec61850
)

@ -1,7 +1,7 @@
LIBIEC_HOME=../..
PROJECT_BINARY_NAME = client_example_files
PROJECT_SOURCES = client_example_files.c
PROJECT_BINARY_NAME = file-tool
PROJECT_SOURCES = file-tool.c
include $(LIBIEC_HOME)/make/target_system.mk
include $(LIBIEC_HOME)/make/stack_includes.mk

@ -1,104 +0,0 @@
/*
* client_example_files.c
*
* This example demonstrates the usage of the file services
*
* - How to browse the file system of the server
* - How to download a file from the server
*
* Note: intended to be used with server_example3
*
*/
#include "iec61850_client.h"
#include <stdlib.h>
#include <stdio.h>
#include "hal_thread.h"
#define MAX_BUFFER_SIZE 2000000
static uint8_t downloadBuffer[MAX_BUFFER_SIZE];
static int bufferPosition = 0;
static bool
downloadHandler(void* parameter, uint8_t* buffer, uint32_t bytesRead)
{
printf("received %i bytes\n", bytesRead);
if (bufferPosition + bytesRead < MAX_BUFFER_SIZE) {
memcpy(downloadBuffer + bufferPosition, buffer, bytesRead);
return true;
}
else
return false;
}
int main(int argc, char** argv) {
char* hostname;
int tcpPort = 102;
if (argc > 1)
hostname = argv[1];
else
hostname = "localhost";
if (argc > 2)
tcpPort = atoi(argv[2]);
IedClientError error;
IedConnection con = IedConnection_create();
IedConnection_connect(con, &error, hostname, tcpPort);
if (error == IED_ERROR_OK) {
/* Get the root directory */
LinkedList rootDirectory =
IedConnection_getFileDirectory(con, &error, NULL);
if (error != IED_ERROR_OK) {
printf("Error retrieving file directory\n");
goto abort_connection;
}
LinkedList directoryEntry = LinkedList_getNext(rootDirectory);
while (directoryEntry != NULL) {
FileDirectoryEntry entry = (FileDirectoryEntry) directoryEntry->data;
printf("%s %i\n", FileDirectoryEntry_getFileName(entry), FileDirectoryEntry_getFileSize(entry));
directoryEntry = LinkedList_getNext(directoryEntry);
}
/* Download a file from the server */
IedConnection_getFile(con, &error, "IEDSERVER.BIN", downloadHandler, NULL);
if (error != IED_ERROR_OK)
printf("Failed to get file!\n");
/* Delete file at server */
IedConnection_deleteFile(con, &error, "IEDSERVER.BIN");
if (error != IED_ERROR_OK)
printf("Failed to delete file! (code=%i)\n", error);
abort_connection:
IedConnection_abort(con, &error);
}
else {
printf("Failed to connect to %s:%i\n", hostname, tcpPort);
}
IedConnection_destroy(con);
}

@ -0,0 +1,265 @@
/*
* file-tool.c
*
* This example demonstrates the usage of the file services
*
* - How to browse the file system of the server
* - How to download a file from the server
*
* Note: intended to be used with server_example3 or server_example_files
*
* Note: DOES NOT WORK WITH VISUAL STUDIO because of libgen.h
*
*/
#include "iec61850_client.h"
#include <stdlib.h>
#include <stdio.h>
#include <libgen.h>
static char* hostname = "localhost";
static int tcpPort = 102;
static char* filename = NULL;
typedef enum {
FileOperationType_None = 0,
FileOperationType_Dir,
FileOperationType_Info,
FileOperationType_Del,
FileOperationType_Get,
FileOperationType_Set
} FileOperationType;
static FileOperationType operation = FileOperationType_None;
static bool
downloadHandler(void* parameter, uint8_t* buffer, uint32_t bytesRead)
{
FILE* fp = (FILE*) parameter;
printf("received %i bytes\n", bytesRead);
if (fwrite(buffer, bytesRead, 1, fp) == 1)
return true;
else {
printf("Failed to write local file!\n");
return false;
}
}
static void
printHelp()
{
printf("file-tool [options] <operation> [<parameters>]\n");
printf(" Options:\n");
printf(" -h <hostname/IP>\n");
printf(" -p portnumber\n");
printf(" Operations\n");
printf(" dir - show directory\n");
printf(" info <filename> - show file info\n");
printf(" del <filename> - delete file\n");
printf(" get <filename> - get file\n");
printf(" set <filename> - set file\n");
}
static int
parseOptions(int argc, char** argv)
{
int currentArgc = 1;
int retVal = 0;
while (currentArgc < argc) {
if (strcmp(argv[currentArgc], "-h") == 0) {
hostname = argv[++currentArgc];
}
else if (strcmp(argv[currentArgc], "-p") == 0) {
tcpPort = atoi(argv[++currentArgc]);
}
else if (strcmp(argv[currentArgc], "del") == 0) {
operation = FileOperationType_Del;
filename = argv[++currentArgc];
}
else if (strcmp(argv[currentArgc], "dir") == 0) {
operation = FileOperationType_Dir;
}
else if (strcmp(argv[currentArgc], "info") == 0) {
operation = FileOperationType_Info;
filename = argv[++currentArgc];
}
else if (strcmp(argv[currentArgc], "get") == 0) {
operation = FileOperationType_Get;
filename = argv[++currentArgc];
}
else if (strcmp(argv[currentArgc], "set") == 0) {
operation = FileOperationType_Set;
filename = argv[++currentArgc];
}
else {
printf("Unknown operation!\n");
return 1;
}
currentArgc++;
}
return retVal;
}
void
showDirectory(IedConnection con)
{
IedClientError error;
/* Get the root directory */
LinkedList rootDirectory =
IedConnection_getFileDirectory(con, &error, NULL);
if (error != IED_ERROR_OK) {
printf("Error retrieving file directory\n");
}
else {
LinkedList directoryEntry = LinkedList_getNext(rootDirectory);
while (directoryEntry != NULL) {
FileDirectoryEntry entry = (FileDirectoryEntry) directoryEntry->data;
printf("%s %i\n", FileDirectoryEntry_getFileName(entry), FileDirectoryEntry_getFileSize(entry));
directoryEntry = LinkedList_getNext(directoryEntry);
}
LinkedList_destroyDeep(rootDirectory, (LinkedListValueDeleteFunction) FileDirectoryEntry_destroy);
}
}
void
getFile(IedConnection con)
{
IedClientError error;
char* bname = strdup(filename);
char* localFilename = basename(bname);
FILE* fp = fopen(localFilename, "w");
if (fp != NULL) {
/* Download a file from the server */
IedConnection_getFile(con, &error, filename, downloadHandler, (void*) fp);
if (error != IED_ERROR_OK)
printf("Failed to get file!\n");
fclose(fp);
}
else
printf("Failed to open file %s\n", localFilename);
free(bname);
}
void
setFile(IedConnection con)
{
IedClientError error;
char* dirc = strdup(filename);
char* basec = strdup(filename);
char* localDirName = dirname(dirc);
char* localFileName = basename(basec);
printf("local dir: %s\n", localDirName);
printf("local file: %s\n", localFileName);
/* IedConnection_setFilestoreBasepath requires the file separator at the end! */
strcpy(dirc, localDirName);
strcat(dirc, "/");
printf("filestore basepath: %s\n", dirc);
IedConnection_setFilestoreBasepath(con, dirc);
IedConnection_setFile(con, &error, localFileName, localFileName);
if (error != IED_ERROR_OK)
printf("Failed to set file! (code=%i)\n", error);
free(dirc);
free(basec);
}
void
deleteFile(IedConnection con)
{
IedClientError error;
/* Delete file at server */
IedConnection_deleteFile(con, &error, filename);
if (error != IED_ERROR_OK)
printf("Failed to delete file! (code=%i)\n", error);
}
int
main(int argc, char** argv)
{
if (argc < 2) {
printHelp();
return 0;
}
parseOptions(argc, argv);
if (operation == FileOperationType_None) {
printHelp();
return 0;
}
IedClientError error;
IedConnection con = IedConnection_create();
IedConnection_connect(con, &error, hostname, tcpPort);
if (error == IED_ERROR_OK) {
switch (operation) {
case FileOperationType_Dir:
showDirectory(con);
break;
case FileOperationType_Get:
getFile(con);
break;
case FileOperationType_Del:
deleteFile(con);
break;
case FileOperationType_Info:
break;
case FileOperationType_Set:
setFile(con);
break;
case FileOperationType_None:
break;
}
IedConnection_abort(con, &error);
}
else {
printf("Failed to connect to %s:%i\n", hostname, tcpPort);
}
IedConnection_destroy(con);
}

@ -132,7 +132,9 @@ int main(int argc, char** argv) {
Thread_sleep(1000);
IedConnection_triggerGIReport(con, &error, "simpleIOGenericIO/LLN0.RP.EventsRCB01");
/* Trigger GI Report */
ClientReportControlBlock_setGI(rcb, true);
IedConnection_setRCBValues(con, &error, rcb, RCB_ELEMENT_GI, true);
if (error != IED_ERROR_OK) {
printf("Error triggering a GI report (code: %i)\n", error);

@ -1,17 +0,0 @@
set(mms_client_example1_SRCS
mms_client_example1.c
)
IF(WIN32)
set_source_files_properties(${mms_client_example1_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(WIN32)
add_executable(mms_client_example1
${mms_client_example1_SRCS}
)
target_link_libraries(mms_client_example1
iec61850
)

@ -1,17 +0,0 @@
LIBIEC_HOME=../..
PROJECT_BINARY_NAME = mms_client_example1
PROJECT_SOURCES = mms_client_example1.c
include $(LIBIEC_HOME)/make/target_system.mk
include $(LIBIEC_HOME)/make/stack_includes.mk
all: $(PROJECT_BINARY_NAME)
include $(LIBIEC_HOME)/make/common_targets.mk
$(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS)
clean:
rm -f $(PROJECT_BINARY_NAME)

@ -1,51 +0,0 @@
/*
* mms_client_example.c
*
* This is the most simple example. It illustrates how to create an MmsConnection
* object and connect to a MMS server.
*
* Copyright 2013 Michael Zillgith
*
* This file is part of libIEC61850.
*
* libIEC61850 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* libIEC61850 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
*
* See COPYING file for the complete license text.
*/
#include <stdlib.h>
#include <stdio.h>
#include "mms_client_connection.h"
#include "hal_thread.h"
int main(int argc, char** argv) {
MmsConnection con = MmsConnection_create();
MmsError mmsError;
if (MmsConnection_connect(con, &mmsError, "localhost", 102)) {
// add application code here
Thread_sleep(1000);
printf("Send abort\n");
MmsConnection_abort(con, &mmsError);
}
else
printf("Connect to server failed!\n");
MmsConnection_destroy(con);
}

@ -1,17 +0,0 @@
set(mms_client_example2_SRCS
mms_client_example2.c
)
IF(MSVC)
set_source_files_properties(${mms_client_example2_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(MSVC)
add_executable(mms_client_example2
${mms_client_example2_SRCS}
)
target_link_libraries(mms_client_example2
iec61850
)

@ -1,17 +0,0 @@
LIBIEC_HOME=../..
PROJECT_BINARY_NAME = mms_client_example2
PROJECT_SOURCES = mms_client_example2.c
include $(LIBIEC_HOME)/make/target_system.mk
include $(LIBIEC_HOME)/make/stack_includes.mk
all: $(PROJECT_BINARY_NAME)
include $(LIBIEC_HOME)/make/common_targets.mk
$(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS)
clean:
rm -f $(PROJECT_BINARY_NAME)

@ -1,64 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include "mms_client_connection.h"
int main(int argc, char** argv) {
char* hostname;
int tcpPort = 102;
if (argc > 1)
hostname = argv[1];
else
hostname = "localhost";
if (argc > 2)
tcpPort = atoi(argv[2]);
MmsConnection con = MmsConnection_create();
MmsError mmsError;
/* Set maximum MMS PDU size (local detail) to 2000 byte */
MmsConnection_setLocalDetail(con, 2000);
if (!MmsConnection_connect(con, &mmsError, hostname, tcpPort)) {
printf("MMS connect failed!\n");
goto exit;
}
else
printf("MMS connected.\n\n");
printf("Domains present on server:\n--------------------------\n");
LinkedList nameList = MmsConnection_getDomainNames(con, &mmsError);
LinkedList_printStringList(nameList);
printf("\n");
LinkedList element = nameList;
while ((element = LinkedList_getNext(element)) != NULL) {
printf("\nNamed variables in domain: %s\n-------------------------------------------------\n", (char*) element->data);
LinkedList variableList = MmsConnection_getDomainVariableNames(con, &mmsError, (char*) element->data);
LinkedList_printStringList(variableList);
LinkedList_destroy(variableList);
printf("\nNamed variable lists (data sets) in domain: %s\n", (char*) element->data);
LinkedList dataSetList = MmsConnection_getDomainVariableListNames(con, &mmsError, (char*) element->data);
LinkedList_printStringList(dataSetList);
LinkedList_destroy(dataSetList);
}
LinkedList_destroy(nameList);
exit:
MmsConnection_destroy(con);
}

@ -1,17 +0,0 @@
set(mms_client_example3_SRCS
mms_client_example3.c
)
IF(MSVC)
set_source_files_properties(${mms_client_example3_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(MSVC)
add_executable(mms_client_example3
${mms_client_example3_SRCS}
)
target_link_libraries(mms_client_example3
iec61850
)

@ -1,17 +0,0 @@
LIBIEC_HOME=../..
PROJECT_BINARY_NAME = mms_client_example3
PROJECT_SOURCES = mms_client_example3.c
include $(LIBIEC_HOME)/make/target_system.mk
include $(LIBIEC_HOME)/make/stack_includes.mk
all: $(PROJECT_BINARY_NAME)
include $(LIBIEC_HOME)/make/common_targets.mk
$(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS)
clean:
rm -f $(PROJECT_BINARY_NAME)

@ -1,41 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include "mms_client_connection.h"
int main(int argc, char** argv) {
char* hostname;
int tcpPort = 102;
if (argc > 1)
hostname = argv[1];
else
hostname = "localhost";
if (argc > 2)
tcpPort = atoi(argv[2]);
MmsConnection con = MmsConnection_create();
MmsError error;
if (!MmsConnection_connect(con, &error, hostname, tcpPort)) {
printf("MMS connect failed!\n");
goto exit;
}
else
printf("MMS connected.\n\n");
MmsValue* value =
MmsConnection_readVariable(con, &error, "simpleIOGenericIO", "LLN0$GO");
if (value == NULL)
printf("reading value failed!\n");
else
MmsValue_delete(value);
exit:
MmsConnection_destroy(con);
}

@ -1,17 +0,0 @@
set(mms_client_example4_SRCS
mms_client_example4.c
)
IF(MSVC)
set_source_files_properties(${mms_client_example4_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(MSVC)
add_executable(mms_client_example4
${mms_client_example4_SRCS}
)
target_link_libraries(mms_client_example4
iec61850
)

@ -1,17 +0,0 @@
LIBIEC_HOME=../..
PROJECT_BINARY_NAME = mms_client_example4
PROJECT_SOURCES = mms_client_example4.c
include $(LIBIEC_HOME)/make/target_system.mk
include $(LIBIEC_HOME)/make/stack_includes.mk
all: $(PROJECT_BINARY_NAME)
include $(LIBIEC_HOME)/make/common_targets.mk
$(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS)
clean:
rm -f $(PROJECT_BINARY_NAME)

@ -1,87 +0,0 @@
/*
* mms_client_example.c
*
* Copyright 2013 Michael Zillgith
*
* This file is part of libIEC61850.
*
* libIEC61850 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* libIEC61850 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
*
* See COPYING file for the complete license text.
*/
#include <stdlib.h>
#include <stdio.h>
#include "mms_client_connection.h"
int main(int argc, char** argv) {
char* hostname;
int tcpPort = 102;
if (argc > 1)
hostname = argv[1];
else
hostname = "localhost";
if (argc > 2)
tcpPort = atoi(argv[2]);
MmsConnection con = MmsConnection_create();
MmsError mmsError;
char* password = "testpw";
/* use authentication */
AcseAuthenticationParameter auth = (AcseAuthenticationParameter) calloc(1, sizeof(struct sAcseAuthenticationParameter));
auth->mechanism = ACSE_AUTH_PASSWORD;
auth->value.password.octetString= (uint8_t*) password;
auth->value.password.passwordLength = strlen(password);
IsoConnectionParameters connectionParameters =
MmsConnection_getIsoConnectionParameters(con);
IsoConnectionParameters_setAcseAuthenticationParameter(connectionParameters, auth);
if (!MmsConnection_connect(con, &mmsError, hostname, tcpPort)) {
printf("MMS connect failed!\n");
goto exit;
}
else
printf("MMS connected.\n\n");
printf("Domains present on server:\n--------------------------\n");
LinkedList nameList = MmsConnection_getDomainNames(con, &mmsError);
LinkedList_printStringList(nameList);
LinkedList_destroy(nameList);
printf("\n");
printf("Named variables for domain SampleIEDDevice1:\n--------------------------------------------\n");
nameList = MmsConnection_getDomainVariableNames(con, &mmsError, "SampleIEDDevice1");
LinkedList_printStringList(nameList);
LinkedList_destroy(nameList);
printf("\n");
printf("Data sets for domain SampleIEDDevice1:\n--------------------------------------------\n");
nameList = MmsConnection_getDomainVariableListNames(con, &mmsError, "SampleIEDDevice1");
LinkedList_printStringList(nameList);
LinkedList_destroy(nameList);
printf("\n");
exit:
MmsConnection_destroy(con);
}

@ -1,17 +0,0 @@
set(mms_client_example5_SRCS
mms_client_example5.c
)
IF(WIN32)
set_source_files_properties(${mms_client_example5_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(WIN32)
add_executable(mms_client_example5
${mms_client_example5_SRCS}
)
target_link_libraries(mms_client_example5
iec61850
)

@ -1,17 +0,0 @@
LIBIEC_HOME=../..
PROJECT_BINARY_NAME = mms_client_example5
PROJECT_SOURCES = mms_client_example5.c
include $(LIBIEC_HOME)/make/target_system.mk
include $(LIBIEC_HOME)/make/stack_includes.mk
all: $(PROJECT_BINARY_NAME)
include $(LIBIEC_HOME)/make/common_targets.mk
$(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS)
clean:
rm -f $(PROJECT_BINARY_NAME)

@ -1,50 +0,0 @@
#include <stdlib.h>
#include <stdio.h>
#include "mms_client_connection.h"
int main(int argc, char** argv) {
char* hostname;
int tcpPort = 102;
if (argc > 1)
hostname = argv[1];
else
hostname = "localhost";
if (argc > 2)
tcpPort = atoi(argv[2]);
MmsConnection con = MmsConnection_create();
MmsError error;
if (!MmsConnection_connect(con, &error, hostname, tcpPort)) {
printf("MMS connect failed!\n");
goto exit;
}
else
printf("MMS connected.\n\n");
LinkedList dataSetEntries = LinkedList_create();
MmsVariableAccessSpecification* dataSetEntry =
MmsVariableAccessSpecification_create("BayControllerQ", "QA1CSWI1$ST$Pos");
LinkedList_add(dataSetEntries, (void*) dataSetEntry);
dataSetEntry =
MmsVariableAccessSpecification_create("BayControllerQ", "QA1XCBR1$ST$Pos");
LinkedList_add(dataSetEntries, (void*) dataSetEntry);
MmsConnection_defineNamedVariableList(con, &error, "BayControllerQ", "LLN0$LIBIEC61850_CLIENT", dataSetEntries);
/* delete list and all elements */
LinkedList_destroy(dataSetEntries);
exit:
MmsConnection_destroy(con);
}

@ -21,7 +21,9 @@ print_help()
printf("-a <domain_name> specify domain for read or write command\n");
printf("-f show file list\n");
printf("-g <filename> get file attributes\n");
printf("-x <filename> delete file\n");
printf("-j <domainName/journalName> read journal\n");
printf("-v <variable list_name> read domain variable list\n");
printf("-m print raw MMS messages\n");
}
@ -79,7 +81,7 @@ printJournalEntries(LinkedList journalEntries)
}
}
void*
void
printRawMmsMessage(void* parameter, uint8_t* message, int messageLength, bool received)
{
if (received)
@ -115,10 +117,12 @@ int main(int argc, char** argv) {
int getFileAttributes = 0;
int readJournal = 0;
int printRawMmsMessages = 0;
int deleteFile = 0;
int readVariableList = 0;
int c;
while ((c = getopt(argc, argv, "mifdh:p:l:t:a:r:g:j:")) != -1)
while ((c = getopt(argc, argv, "mifdh:p:l:t:a:r:g:j:x:v:")) != -1)
switch (c) {
case 'm':
printRawMmsMessages = 1;
@ -151,6 +155,10 @@ int main(int argc, char** argv) {
readVariable = 1;
variableName = StringUtils_copyString(optarg);
break;
case 'v':
readVariableList = 1;
variableName = StringUtils_copyString(optarg);
break;
case 'f':
showFileList = 1;
break;
@ -158,6 +166,10 @@ int main(int argc, char** argv) {
getFileAttributes = 1;
filename = StringUtils_copyString(optarg);
break;
case 'x':
deleteFile = 1;
filename = StringUtils_copyString(optarg);
break;
case 'j':
readJournal = 1;
@ -336,6 +348,21 @@ int main(int argc, char** argv) {
printf("Reading VMD scope variable not yet supported!\n");
}
if (readVariableList) {
if (readWriteHasDomain) {
MmsValue* variables = MmsConnection_readNamedVariableListValues(con, &error, domainName, variableName, true);
if (error != MMS_ERROR_NONE) {
printf("Reading variable failed: (ERROR %i)\n", error);
}
else {
printf("Read SUCCESS\n");
}
}
else
printf("Reading VMD scope variable list not yet supported!\n");
}
if (showFileList) {
char lastName[300];
lastName[0] = 0;
@ -351,6 +378,17 @@ int main(int argc, char** argv) {
MmsConnection_getFileDirectory(con, &error, filename, NULL, mmsGetFileAttributeHandler, NULL);
}
if (deleteFile) {
MmsConnection_fileDelete(con, &error, filename);
if (error != MMS_ERROR_NONE) {
printf("Delete file failed: (ERROR %i)\n", error);
}
else {
printf("File deleted\n");
}
}
exit:
free(hostname);
MmsConnection_destroy(con);

@ -1,21 +0,0 @@
include_directories(
.
)
set(server_example1_SRCS
server_example1.c
static_model.c
)
IF(WIN32)
set_source_files_properties(${server_example1_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(WIN32)
add_executable(server_example1
${server_example1_SRCS}
)
target_link_libraries(server_example1
iec61850
)

@ -1,21 +0,0 @@
include_directories(
.
)
set(server_example2_SRCS
server_example2.c
static_model.c
)
IF(WIN32)
set_source_files_properties(${server_example2_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(WIN32)
add_executable(server_example2
${server_example2_SRCS}
)
target_link_libraries(server_example2
iec61850
)

@ -1,24 +0,0 @@
LIBIEC_HOME=../..
PROJECT_BINARY_NAME = server_example2
PROJECT_SOURCES = server_example2.c
PROJECT_SOURCES += static_model.c
PROJECT_ICD_FILE = complexModel.icd
include $(LIBIEC_HOME)/make/target_system.mk
include $(LIBIEC_HOME)/make/stack_includes.mk
all: $(PROJECT_BINARY_NAME)
include $(LIBIEC_HOME)/make/common_targets.mk
model: $(PROJECT_ICD_FILE)
java -jar $(LIBIEC_HOME)/tools/model_generator/genmodel.jar $(PROJECT_ICD_FILE)
$(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDFLAGS) $(LDLIBS)
clean:
rm -f $(PROJECT_BINARY_NAME)

@ -1,347 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<SCL xmlns="http://www.iec.ch/61850/2003/SCL">
<Header id="" />
<IED name="ied1">
<Services>
<DynAssociation />
<GetDirectory />
<GetDataObjectDefinition />
<GetDataSetValue />
<DataSetDirectory />
<ReadWrite />
<GetCBValues />
<ConfLNs fixPrefix="true" fixLnInst="true" />
</Services>
<AccessPoint name="accessPoint1">
<Server>
<Authentication password="true" />
<LDevice inst="Inverter">
<LN0 lnClass="LLN0" lnType="LLN02" inst="">
<DataSet name="dataset1" desc="">
<FCDA ldInst="Inverter" lnClass="LLN0" fc="ST" doName="Mod" daName="q" />
<FCDA ldInst="Battery" lnClass="LLN0" fc="ST" doName="Mod" daName="q" />
<FCDA ldInst="Inverter" lnClass="MMXU" fc="ST" lnInst="1" doName="Mod" daName="q" />
<FCDA ldInst="Inverter" lnClass="MMXU" fc="CF" lnInst="1" doName="Mod" daName="ctlModel" />
<FCDA ldInst="Inverter" lnClass="MMXU" fc="MX" lnInst="1" doName="TotW" daName="mag" />
</DataSet>
<ReportControl name="rcb1" confRev="0" datSet="dataset1" rptID="ID" intgPd="0" bufTime="0">
<TrgOps dchg="true" qchg="true" />
<OptFields />
</ReportControl>
<DOI name="Mod">
<DAI name="ctlModel">
<Val>status-only</Val>
</DAI>
</DOI>
</LN0>
<LN lnClass="LPHD" lnType="LPHD2" inst="1" prefix="" />
<LN lnClass="ZINV" lnType="ZINV3" inst="1" prefix="">
<DOI name="Mod">
<DAI name="ctlModel">
<Val>status-only</Val>
</DAI>
</DOI>
</LN>
<LN lnClass="MMXU" lnType="MMXU1" inst="1" prefix="">
<DOI name="Mod">
<DAI name="ctlModel">
<Val>status-only</Val>
</DAI>
</DOI>
</LN>
</LDevice>
<LDevice inst="Battery">
<LN0 lnClass="LLN0" lnType="LLN03" inst="">
<DOI name="Mod">
<DAI name="ctlModel">
<Val>status-only</Val>
</DAI>
</DOI>
</LN0>
<LN lnClass="LPHD" lnType="LPHD3" inst="1" prefix="" />
<LN lnClass="ZBAT" lnType="ZBAT1" inst="1" prefix="">
<DOI name="Mod">
<DAI name="ctlModel">
<Val>status-only</Val>
</DAI>
</DOI>
</LN>
<LN lnClass="ZBTC" lnType="ZBTC1" inst="1" prefix="">
<DOI name="Mod">
<DAI name="ctlModel">
<Val>status-only</Val>
</DAI>
</DOI>
</LN>
</LDevice>
<LDevice inst="Physical_Measurements">
<LN0 lnClass="LLN0" lnType="LLN01" inst="">
<DOI name="Mod">
<DAI name="ctlModel">
<Val>status-only</Val>
</DAI>
</DOI>
</LN0>
<LN lnClass="LPHD" lnType="LPHD1" inst="1" prefix="" />
</LDevice>
</Server>
</AccessPoint>
</IED>
<DataTypeTemplates>
<LNodeType id="MMXU1" lnClass="MMXU" desc="Measurement">
<DO name="Mod" type="INC_1_Mod" />
<DO name="Beh" type="INS_1_Beh" />
<DO name="Health" type="INS_1_Beh" />
<DO name="NamPlt" type="LPL_2_NamPlt" />
<DO name="TotW" type="MV_1_Vol" />
<DO name="TotVAr" type="MV_1_Vol" />
<DO name="TotVA" type="MV_1_Vol" />
<DO name="Hz" type="MV_1_Vol" />
<DO name="PhV" type="WYE_1_PhV" />
<DO name="A" type="WYE_1_PhV" />
<DO name="W" type="WYE_1_W" />
</LNodeType>
<LNodeType id="ZBTC1" lnClass="ZBTC" desc="Battery charger">
<DO name="Mod" type="ENC_1_Mod" />
<DO name="Beh" type="ENS_1_Beh" />
<DO name="Health" type="ENS_1_Beh" />
<DO name="NamPlt" type="LPL_2_NamPlt" />
<DO name="BatChaSt" type="ENG_1_BatChaSt" />
<DO name="BatChaPwr" type="ASG_1_BatChaPwr" />
<DO name="BatChaMod" type="ENG_1_BatChaSt" />
<DO name="ChaV" type="MV_1_Vol" />
<DO name="ChaA" type="MV_1_Vol" />
</LNodeType>
<LNodeType id="ZBAT1" lnClass="ZBAT" desc="Battery">
<DO name="Mod" type="INC_1_Mod" />
<DO name="Beh" type="INS_1_Beh" />
<DO name="Health" type="INS_1_Beh" />
<DO name="NamPlt" type="LPL_2_NamPlt" />
<DO name="Vol" type="MV_1_Vol" />
<DO name="Amp" type="MV_1_Vol" />
</LNodeType>
<LNodeType id="LPHD1" lnClass="LPHD" desc="Physical device information">
<DO name="PhyNam" type="DPL_1_PhyNam" />
<DO name="PhyHealth" type="INS_1_Beh" />
<DO name="Proxy" type="SPS_1_Proxy" />
</LNodeType>
<LNodeType id="LLN01" lnClass="LLN0" desc="Logical node zero">
<DO name="Mod" type="INC_1_Mod" />
<DO name="Beh" type="INS_1_Beh" />
<DO name="Health" type="INS_1_Beh" />
<DO name="NamPlt" type="LPL_1_NamPlt" />
</LNodeType>
<LNodeType id="LLN02" lnClass="LLN0" desc="Logical node zero">
<DO name="Mod" type="INC_1_Mod" />
<DO name="Beh" type="INS_1_Beh" />
<DO name="Health" type="INS_1_Beh" />
<DO name="NamPlt" type="LPL_1_NamPlt" />
</LNodeType>
<LNodeType id="LPHD2" lnClass="LPHD" desc="Physical device information">
<DO name="PhyNam" type="DPL_1_PhyNam" />
<DO name="PhyHealth" type="INS_1_Beh" />
<DO name="Proxy" type="SPS_1_Proxy" />
</LNodeType>
<LNodeType id="LLN03" lnClass="LLN0" desc="Logical node zero">
<DO name="Mod" type="INC_1_Mod" />
<DO name="Beh" type="INS_1_Beh" />
<DO name="Health" type="INS_1_Beh" />
<DO name="NamPlt" type="LPL_1_NamPlt" />
</LNodeType>
<LNodeType id="LPHD3" lnClass="LPHD" desc="Physical device information">
<DO name="PhyNam" type="DPL_1_PhyNam" />
<DO name="PhyHealth" type="INS_1_Beh" />
<DO name="Proxy" type="SPS_1_Proxy" />
</LNodeType>
<LNodeType id="ZINV3" lnClass="ZINV" desc="Inverter">
<DO name="Mod" type="ENC_1_Mod" />
<DO name="Beh" type="ENS_1_Beh" />
<DO name="Health" type="ENS_1_Beh" />
<DO name="NamPlt" type="LPL_2_NamPlt" />
<DO name="WRtg" type="ASG_1_WRtg" />
<DO name="VarRtg" type="ASG_1_WRtg" />
<DO name="ACTyp" type="ENG_1_ACTyp" />
<DO name="OutWSet" type="ASG_1_WRtg" />
<DO name="OutVarSet" type="ASG_1_WRtg" />
</LNodeType>
<DOType id="INC_1_Mod" cdc="INC">
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="t" bType="Timestamp" fc="ST" />
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
</DOType>
<DOType id="INS_1_Beh" cdc="INS">
<DA name="stVal" bType="INT32" fc="ST" dchg="true" />
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="t" bType="Timestamp" fc="ST" />
</DOType>
<DOType id="LPL_1_NamPlt" cdc="LPL">
<DA name="vendor" bType="VisString255" fc="DC" />
<DA name="swRev" bType="VisString255" fc="DC" />
<DA name="d" bType="VisString255" fc="DC" />
<DA name="configRev" bType="VisString255" fc="DC" />
<DA name="ldNs" bType="VisString255" fc="EX" />
</DOType>
<DOType id="DPL_1_PhyNam" cdc="DPL">
<DA name="vendor" bType="VisString255" fc="DC" />
</DOType>
<DOType id="SPS_1_Proxy" cdc="SPS">
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="t" bType="Timestamp" fc="ST" />
</DOType>
<DOType id="LPL_2_NamPlt" cdc="LPL">
<DA name="vendor" bType="VisString255" fc="DC" />
<DA name="swRev" bType="VisString255" fc="DC" />
<DA name="d" bType="VisString255" fc="DC" />
</DOType>
<DOType id="ENC_1_Mod" cdc="ENC">
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="t" bType="Timestamp" fc="ST" />
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
</DOType>
<DOType id="ENS_1_Beh" cdc="ENS">
<DA name="stVal" bType="INT32" fc="ST" dchg="true" />
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="t" bType="Timestamp" fc="ST" />
</DOType>
<DOType id="WYE_1_W" cdc="WYE">
<SDO name="phsA" type="CMV_1_phsA" />
<SDO name="phsB" type="CMV_1_phsA" />
<SDO name="phsC" type="CMV_1_phsA" />
</DOType>
<DOType id="CMV_1_phsA" cdc="CMV">
<DA name="cVal" type="Vector_1" bType="Struct" fc="MX" dchg="true" />
<DA name="q" bType="Quality" fc="MX" qchg="true" />
<DA name="t" bType="Timestamp" fc="MX" />
</DOType>
<DOType id="ASG_1_BatChaPwr" cdc="ASG" />
<DOType id="ENG_1_BatChaSt" cdc="ENG" />
<DOType id="WYE_1_PhV" cdc="WYE">
<SDO name="phsA" type="CMV_1_phsA" />
<SDO name="phsB" type="CMV_1_phsA" />
<SDO name="phsC" type="CMV_1_phsA" />
<SDO name="neut" type="CMV_1_phsA" />
</DOType>
<DOType id="MV_1_Vol" cdc="MV">
<DA name="mag" type="AnalogueValue_1" bType="Struct" fc="MX" dchg="true" />
<DA name="q" bType="Quality" fc="MX" qchg="true" />
<DA name="t" bType="Timestamp" fc="MX" />
</DOType>
<DOType id="ASG_1_WRtg" cdc="ASG">
<DA name="setMag" type="AnalogueValue_1" bType="Struct" fc="SP" />
<DA name="units" type="Unit_1" bType="Struct" fc="CF" />
</DOType>
<DOType id="ENG_1_ACTyp" cdc="ENG">
<DA name="setVal" bType="INT32" fc="SP" />
</DOType>
<DAType id="AnalogueValue_1">
<BDA name="f" bType="FLOAT32" />
</DAType>
<DAType id="Vector_1">
<BDA name="mag" type="AnalogueValue_1" bType="Struct" />
</DAType>
<DAType id="Unit_1">
<BDA name="SIUnit" type="SIUnit" bType="Enum" />
</DAType>
<EnumType id="CtlModels">
<EnumVal ord="0">status-only</EnumVal>
<EnumVal ord="1">direct-with-normal-security</EnumVal>
<EnumVal ord="2">sbo-with-normal-security</EnumVal>
<EnumVal ord="3">direct-with-enhanced-security</EnumVal>
<EnumVal ord="4">sbo-with-enhanced-security</EnumVal>
</EnumType>
<EnumType id="SIUnit">
<EnumVal ord="1">
</EnumVal>
<EnumVal ord="10">rad</EnumVal>
<EnumVal ord="11">sr</EnumVal>
<EnumVal ord="2">m</EnumVal>
<EnumVal ord="21">Gy</EnumVal>
<EnumVal ord="22">q</EnumVal>
<EnumVal ord="23">ðC</EnumVal>
<EnumVal ord="24">Sv</EnumVal>
<EnumVal ord="25">F</EnumVal>
<EnumVal ord="26">C</EnumVal>
<EnumVal ord="27">S</EnumVal>
<EnumVal ord="28">H</EnumVal>
<EnumVal ord="29">V</EnumVal>
<EnumVal ord="3">kg</EnumVal>
<EnumVal ord="30">ohm</EnumVal>
<EnumVal ord="31">J</EnumVal>
<EnumVal ord="32">N</EnumVal>
<EnumVal ord="33">Hz</EnumVal>
<EnumVal ord="34">Ix</EnumVal>
<EnumVal ord="35">Lm</EnumVal>
<EnumVal ord="36">Wb</EnumVal>
<EnumVal ord="37">T</EnumVal>
<EnumVal ord="38">W</EnumVal>
<EnumVal ord="39">Pa</EnumVal>
<EnumVal ord="4">s</EnumVal>
<EnumVal ord="41">mò</EnumVal>
<EnumVal ord="42">mó</EnumVal>
<EnumVal ord="43">m/s</EnumVal>
<EnumVal ord="44">m/sò</EnumVal>
<EnumVal ord="45">mó/s</EnumVal>
<EnumVal ord="46">m/mó</EnumVal>
<EnumVal ord="47">M</EnumVal>
<EnumVal ord="48">kg/mó</EnumVal>
<EnumVal ord="49">mò/s</EnumVal>
<EnumVal ord="5">A</EnumVal>
<EnumVal ord="50">W/m K</EnumVal>
<EnumVal ord="51">J/K</EnumVal>
<EnumVal ord="52">ppm</EnumVal>
<EnumVal ord="53">1/s</EnumVal>
<EnumVal ord="54">rad/s</EnumVal>
<EnumVal ord="6">K</EnumVal>
<EnumVal ord="61">VA</EnumVal>
<EnumVal ord="62">Watts</EnumVal>
<EnumVal ord="63">VAr</EnumVal>
<EnumVal ord="64">theta</EnumVal>
<EnumVal ord="65">cos(theta)</EnumVal>
<EnumVal ord="66">Vs</EnumVal>
<EnumVal ord="67">Vò</EnumVal>
<EnumVal ord="68">As</EnumVal>
<EnumVal ord="69">Aò</EnumVal>
<EnumVal ord="7">mol</EnumVal>
<EnumVal ord="70">Aòt</EnumVal>
<EnumVal ord="71">VAh</EnumVal>
<EnumVal ord="72">Wh</EnumVal>
<EnumVal ord="73">VArh</EnumVal>
<EnumVal ord="74">V/Hz</EnumVal>
<EnumVal ord="8">cd</EnumVal>
<EnumVal ord="9">deg</EnumVal>
</EnumType>
<EnumType id="Multiplier">
<EnumVal ord="-24">Yocto</EnumVal>
<EnumVal ord="-21">Zepto</EnumVal>
<EnumVal ord="-18">Atto</EnumVal>
<EnumVal ord="-15">Femto</EnumVal>
<EnumVal ord="-12">Pico</EnumVal>
<EnumVal ord="-9">Nano</EnumVal>
<EnumVal ord="-6">Micro</EnumVal>
<EnumVal ord="-3">Milli</EnumVal>
<EnumVal ord="-2">Centi</EnumVal>
<EnumVal ord="-1">Deci</EnumVal>
<EnumVal ord="0">zeroNoValue</EnumVal>
<EnumVal ord="1">Deca</EnumVal>
<EnumVal ord="2">Hecto</EnumVal>
<EnumVal ord="3">Kilo</EnumVal>
<EnumVal ord="6">Mega</EnumVal>
<EnumVal ord="9">Giga</EnumVal>
<EnumVal ord="12">Tera</EnumVal>
<EnumVal ord="15">Petra</EnumVal>
<EnumVal ord="18">Exa</EnumVal>
<EnumVal ord="21">Zetta</EnumVal>
<EnumVal ord="24">Yotta</EnumVal>
</EnumType>
<EnumType id="Range">
<EnumVal ord="0">normal</EnumVal>
<EnumVal ord="1">high</EnumVal>
<EnumVal ord="2">low</EnumVal>
<EnumVal ord="3">high-high</EnumVal>
<EnumVal ord="4">low-low</EnumVal>
</EnumType>
</DataTypeTemplates>
</SCL>

@ -1,91 +0,0 @@
/*
* server_example2.c
*
* Copyright 2013 Michael Zillgith
*
* This file is part of libIEC61850.
*
* libIEC61850 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* libIEC61850 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
*
* See COPYING file for the complete license text.
*/
#include "iec61850_server.h"
#include "hal_thread.h"
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
/* Include the generated header with the model access handles */
#include "static_model.h"
/* import IEC 61850 device model created from SCL-File */
extern IedModel iedModel;
static int running = 0;
void sigint_handler(int signalId)
{
running = 0;
}
int
main(int argc, char** argv)
{
IedServer iedServer = IedServer_create(&iedModel);
// TODO get stored values from persistent storage
// TODO set initial measurement and status values from process
/* MMS server will be instructed to start listening to client connections. */
IedServer_start(iedServer, 102);
if (!IedServer_isRunning(iedServer)) {
printf("Starting server failed! Exit.\n");
IedServer_destroy(iedServer);
exit(-1);
}
running = 1;
signal(SIGINT, sigint_handler);
float power = 500.f;
while (running) {
uint64_t timeval = Hal_getTimeInMs();
IedServer_lockDataModel(iedServer);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_Inverter_MMXU1_TotW_t, timeval);
IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_Inverter_MMXU1_TotW_mag_f, power);
IedServer_unlockDataModel(iedServer);
power += 0.1f;
Thread_sleep(500);
}
/* stop MMS server - close TCP server socket and all client sockets */
IedServer_stop(iedServer);
/* Cleanup - free all resources */
IedServer_destroy(iedServer);
return 0;
} /* main() */

File diff suppressed because it is too large Load Diff

@ -1,21 +0,0 @@
include_directories(
.
)
set(server_example3_SRCS
server_example3.c
static_model.c
)
IF(WIN32)
set_source_files_properties(${server_example3_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(WIN32)
add_executable(server_example3
${server_example3_SRCS}
)
target_link_libraries(server_example3
iec61850
)

@ -1,21 +0,0 @@
include_directories(
.
)
set(server_example4_SRCS
server_example4.c
static_model.c
)
IF(WIN32)
set_source_files_properties(${server_example4_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(WIN32)
add_executable(server_example4
${server_example4_SRCS}
)
target_link_libraries(server_example4
iec61850
)

@ -1,21 +0,0 @@
include_directories(
.
)
set(server_example5_SRCS
server_example5.c
static_model.c
)
IF(WIN32)
set_source_files_properties(${server_example5_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(WIN32)
add_executable(server_example5
${server_example5_SRCS}
)
target_link_libraries(server_example5
iec61850
)

@ -1,609 +0,0 @@
/*
* static_model.h
*
* automatically generated from complexModel.icd
*/
#ifndef STATIC_MODEL_H_
#define STATIC_MODEL_H_
#include <stdlib.h>
#include "iec61850_model.h"
extern IedModel iedModel;
extern LogicalDevice iedModel_Inverter;
extern LogicalNode iedModel_Inverter_LLN0;
extern DataObject iedModel_Inverter_LLN0_Mod;
extern DataAttribute iedModel_Inverter_LLN0_Mod_q;
extern DataAttribute iedModel_Inverter_LLN0_Mod_t;
extern DataAttribute iedModel_Inverter_LLN0_Mod_ctlModel;
extern DataObject iedModel_Inverter_LLN0_Beh;
extern DataAttribute iedModel_Inverter_LLN0_Beh_stVal;
extern DataAttribute iedModel_Inverter_LLN0_Beh_q;
extern DataAttribute iedModel_Inverter_LLN0_Beh_t;
extern DataObject iedModel_Inverter_LLN0_Health;
extern DataAttribute iedModel_Inverter_LLN0_Health_stVal;
extern DataAttribute iedModel_Inverter_LLN0_Health_q;
extern DataAttribute iedModel_Inverter_LLN0_Health_t;
extern DataObject iedModel_Inverter_LLN0_NamPlt;
extern DataAttribute iedModel_Inverter_LLN0_NamPlt_vendor;
extern DataAttribute iedModel_Inverter_LLN0_NamPlt_swRev;
extern DataAttribute iedModel_Inverter_LLN0_NamPlt_d;
extern DataAttribute iedModel_Inverter_LLN0_NamPlt_configRev;
extern DataAttribute iedModel_Inverter_LLN0_NamPlt_ldNs;
extern LogicalNode iedModel_Inverter_LPHD1;
extern DataObject iedModel_Inverter_LPHD1_PhyNam;
extern DataAttribute iedModel_Inverter_LPHD1_PhyNam_vendor;
extern DataObject iedModel_Inverter_LPHD1_PhyHealth;
extern DataAttribute iedModel_Inverter_LPHD1_PhyHealth_stVal;
extern DataAttribute iedModel_Inverter_LPHD1_PhyHealth_q;
extern DataAttribute iedModel_Inverter_LPHD1_PhyHealth_t;
extern DataObject iedModel_Inverter_LPHD1_Proxy;
extern DataAttribute iedModel_Inverter_LPHD1_Proxy_stVal;
extern DataAttribute iedModel_Inverter_LPHD1_Proxy_q;
extern DataAttribute iedModel_Inverter_LPHD1_Proxy_t;
extern LogicalNode iedModel_Inverter_ZINV1;
extern DataObject iedModel_Inverter_ZINV1_Mod;
extern DataAttribute iedModel_Inverter_ZINV1_Mod_q;
extern DataAttribute iedModel_Inverter_ZINV1_Mod_t;
extern DataAttribute iedModel_Inverter_ZINV1_Mod_ctlModel;
extern DataObject iedModel_Inverter_ZINV1_Beh;
extern DataAttribute iedModel_Inverter_ZINV1_Beh_stVal;
extern DataAttribute iedModel_Inverter_ZINV1_Beh_q;
extern DataAttribute iedModel_Inverter_ZINV1_Beh_t;
extern DataObject iedModel_Inverter_ZINV1_Health;
extern DataAttribute iedModel_Inverter_ZINV1_Health_stVal;
extern DataAttribute iedModel_Inverter_ZINV1_Health_q;
extern DataAttribute iedModel_Inverter_ZINV1_Health_t;
extern DataObject iedModel_Inverter_ZINV1_NamPlt;
extern DataAttribute iedModel_Inverter_ZINV1_NamPlt_vendor;
extern DataAttribute iedModel_Inverter_ZINV1_NamPlt_swRev;
extern DataAttribute iedModel_Inverter_ZINV1_NamPlt_d;
extern DataObject iedModel_Inverter_ZINV1_WRtg;
extern DataAttribute iedModel_Inverter_ZINV1_WRtg_setMag;
extern DataAttribute iedModel_Inverter_ZINV1_WRtg_setMag_f;
extern DataAttribute iedModel_Inverter_ZINV1_WRtg_units;
extern DataAttribute iedModel_Inverter_ZINV1_WRtg_units_SIUnit;
extern DataObject iedModel_Inverter_ZINV1_VarRtg;
extern DataAttribute iedModel_Inverter_ZINV1_VarRtg_setMag;
extern DataAttribute iedModel_Inverter_ZINV1_VarRtg_setMag_f;
extern DataAttribute iedModel_Inverter_ZINV1_VarRtg_units;
extern DataAttribute iedModel_Inverter_ZINV1_VarRtg_units_SIUnit;
extern DataObject iedModel_Inverter_ZINV1_ACTyp;
extern DataAttribute iedModel_Inverter_ZINV1_ACTyp_setVal;
extern DataObject iedModel_Inverter_ZINV1_OutWSet;
extern DataAttribute iedModel_Inverter_ZINV1_OutWSet_setMag;
extern DataAttribute iedModel_Inverter_ZINV1_OutWSet_setMag_f;
extern DataAttribute iedModel_Inverter_ZINV1_OutWSet_units;
extern DataAttribute iedModel_Inverter_ZINV1_OutWSet_units_SIUnit;
extern DataObject iedModel_Inverter_ZINV1_OutVarSet;
extern DataAttribute iedModel_Inverter_ZINV1_OutVarSet_setMag;
extern DataAttribute iedModel_Inverter_ZINV1_OutVarSet_setMag_f;
extern DataAttribute iedModel_Inverter_ZINV1_OutVarSet_units;
extern DataAttribute iedModel_Inverter_ZINV1_OutVarSet_units_SIUnit;
extern LogicalNode iedModel_Inverter_MMXU1;
extern DataObject iedModel_Inverter_MMXU1_Mod;
extern DataAttribute iedModel_Inverter_MMXU1_Mod_q;
extern DataAttribute iedModel_Inverter_MMXU1_Mod_t;
extern DataAttribute iedModel_Inverter_MMXU1_Mod_ctlModel;
extern DataObject iedModel_Inverter_MMXU1_Beh;
extern DataAttribute iedModel_Inverter_MMXU1_Beh_stVal;
extern DataAttribute iedModel_Inverter_MMXU1_Beh_q;
extern DataAttribute iedModel_Inverter_MMXU1_Beh_t;
extern DataObject iedModel_Inverter_MMXU1_Health;
extern DataAttribute iedModel_Inverter_MMXU1_Health_stVal;
extern DataAttribute iedModel_Inverter_MMXU1_Health_q;
extern DataAttribute iedModel_Inverter_MMXU1_Health_t;
extern DataObject iedModel_Inverter_MMXU1_NamPlt;
extern DataAttribute iedModel_Inverter_MMXU1_NamPlt_vendor;
extern DataAttribute iedModel_Inverter_MMXU1_NamPlt_swRev;
extern DataAttribute iedModel_Inverter_MMXU1_NamPlt_d;
extern DataObject iedModel_Inverter_MMXU1_TotW;
extern DataAttribute iedModel_Inverter_MMXU1_TotW_mag;
extern DataAttribute iedModel_Inverter_MMXU1_TotW_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_TotW_q;
extern DataAttribute iedModel_Inverter_MMXU1_TotW_t;
extern DataObject iedModel_Inverter_MMXU1_TotVAr;
extern DataAttribute iedModel_Inverter_MMXU1_TotVAr_mag;
extern DataAttribute iedModel_Inverter_MMXU1_TotVAr_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_TotVAr_q;
extern DataAttribute iedModel_Inverter_MMXU1_TotVAr_t;
extern DataObject iedModel_Inverter_MMXU1_TotVA;
extern DataAttribute iedModel_Inverter_MMXU1_TotVA_mag;
extern DataAttribute iedModel_Inverter_MMXU1_TotVA_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_TotVA_q;
extern DataAttribute iedModel_Inverter_MMXU1_TotVA_t;
extern DataObject iedModel_Inverter_MMXU1_Hz;
extern DataAttribute iedModel_Inverter_MMXU1_Hz_mag;
extern DataAttribute iedModel_Inverter_MMXU1_Hz_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_Hz_q;
extern DataAttribute iedModel_Inverter_MMXU1_Hz_t;
extern DataObject iedModel_Inverter_MMXU1_PhV;
extern DataObject iedModel_Inverter_MMXU1_PhV_phsA;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsA_cVal;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsA_cVal_mag;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsA_cVal_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsA_q;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsA_t;
extern DataObject iedModel_Inverter_MMXU1_PhV_phsB;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsB_cVal;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsB_cVal_mag;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsB_cVal_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsB_q;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsB_t;
extern DataObject iedModel_Inverter_MMXU1_PhV_phsC;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsC_cVal;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsC_cVal_mag;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsC_cVal_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsC_q;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_phsC_t;
extern DataObject iedModel_Inverter_MMXU1_PhV_neut;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_neut_cVal;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_neut_cVal_mag;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_neut_cVal_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_neut_q;
extern DataAttribute iedModel_Inverter_MMXU1_PhV_neut_t;
extern DataObject iedModel_Inverter_MMXU1_A;
extern DataObject iedModel_Inverter_MMXU1_A_phsA;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsA_cVal;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsA_cVal_mag;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsA_cVal_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsA_q;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsA_t;
extern DataObject iedModel_Inverter_MMXU1_A_phsB;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsB_cVal;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsB_cVal_mag;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsB_cVal_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsB_q;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsB_t;
extern DataObject iedModel_Inverter_MMXU1_A_phsC;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsC_cVal;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsC_cVal_mag;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsC_cVal_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsC_q;
extern DataAttribute iedModel_Inverter_MMXU1_A_phsC_t;
extern DataObject iedModel_Inverter_MMXU1_A_neut;
extern DataAttribute iedModel_Inverter_MMXU1_A_neut_cVal;
extern DataAttribute iedModel_Inverter_MMXU1_A_neut_cVal_mag;
extern DataAttribute iedModel_Inverter_MMXU1_A_neut_cVal_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_A_neut_q;
extern DataAttribute iedModel_Inverter_MMXU1_A_neut_t;
extern DataObject iedModel_Inverter_MMXU1_W;
extern DataObject iedModel_Inverter_MMXU1_W_phsA;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsA_cVal;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsA_cVal_mag;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsA_cVal_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsA_q;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsA_t;
extern DataObject iedModel_Inverter_MMXU1_W_phsB;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsB_cVal;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsB_cVal_mag;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsB_cVal_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsB_q;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsB_t;
extern DataObject iedModel_Inverter_MMXU1_W_phsC;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsC_cVal;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsC_cVal_mag;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsC_cVal_mag_f;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsC_q;
extern DataAttribute iedModel_Inverter_MMXU1_W_phsC_t;
extern LogicalDevice iedModel_Battery;
extern LogicalNode iedModel_Battery_LLN0;
extern DataObject iedModel_Battery_LLN0_Mod;
extern DataAttribute iedModel_Battery_LLN0_Mod_q;
extern DataAttribute iedModel_Battery_LLN0_Mod_t;
extern DataAttribute iedModel_Battery_LLN0_Mod_ctlModel;
extern DataObject iedModel_Battery_LLN0_Beh;
extern DataAttribute iedModel_Battery_LLN0_Beh_stVal;
extern DataAttribute iedModel_Battery_LLN0_Beh_q;
extern DataAttribute iedModel_Battery_LLN0_Beh_t;
extern DataObject iedModel_Battery_LLN0_Health;
extern DataAttribute iedModel_Battery_LLN0_Health_stVal;
extern DataAttribute iedModel_Battery_LLN0_Health_q;
extern DataAttribute iedModel_Battery_LLN0_Health_t;
extern DataObject iedModel_Battery_LLN0_NamPlt;
extern DataAttribute iedModel_Battery_LLN0_NamPlt_vendor;
extern DataAttribute iedModel_Battery_LLN0_NamPlt_swRev;
extern DataAttribute iedModel_Battery_LLN0_NamPlt_d;
extern DataAttribute iedModel_Battery_LLN0_NamPlt_configRev;
extern DataAttribute iedModel_Battery_LLN0_NamPlt_ldNs;
extern LogicalNode iedModel_Battery_LPHD1;
extern DataObject iedModel_Battery_LPHD1_PhyNam;
extern DataAttribute iedModel_Battery_LPHD1_PhyNam_vendor;
extern DataObject iedModel_Battery_LPHD1_PhyHealth;
extern DataAttribute iedModel_Battery_LPHD1_PhyHealth_stVal;
extern DataAttribute iedModel_Battery_LPHD1_PhyHealth_q;
extern DataAttribute iedModel_Battery_LPHD1_PhyHealth_t;
extern DataObject iedModel_Battery_LPHD1_Proxy;
extern DataAttribute iedModel_Battery_LPHD1_Proxy_stVal;
extern DataAttribute iedModel_Battery_LPHD1_Proxy_q;
extern DataAttribute iedModel_Battery_LPHD1_Proxy_t;
extern LogicalNode iedModel_Battery_ZBAT1;
extern DataObject iedModel_Battery_ZBAT1_Mod;
extern DataAttribute iedModel_Battery_ZBAT1_Mod_q;
extern DataAttribute iedModel_Battery_ZBAT1_Mod_t;
extern DataAttribute iedModel_Battery_ZBAT1_Mod_ctlModel;
extern DataObject iedModel_Battery_ZBAT1_Beh;
extern DataAttribute iedModel_Battery_ZBAT1_Beh_stVal;
extern DataAttribute iedModel_Battery_ZBAT1_Beh_q;
extern DataAttribute iedModel_Battery_ZBAT1_Beh_t;
extern DataObject iedModel_Battery_ZBAT1_Health;
extern DataAttribute iedModel_Battery_ZBAT1_Health_stVal;
extern DataAttribute iedModel_Battery_ZBAT1_Health_q;
extern DataAttribute iedModel_Battery_ZBAT1_Health_t;
extern DataObject iedModel_Battery_ZBAT1_NamPlt;
extern DataAttribute iedModel_Battery_ZBAT1_NamPlt_vendor;
extern DataAttribute iedModel_Battery_ZBAT1_NamPlt_swRev;
extern DataAttribute iedModel_Battery_ZBAT1_NamPlt_d;
extern DataObject iedModel_Battery_ZBAT1_Vol;
extern DataAttribute iedModel_Battery_ZBAT1_Vol_mag;
extern DataAttribute iedModel_Battery_ZBAT1_Vol_mag_f;
extern DataAttribute iedModel_Battery_ZBAT1_Vol_q;
extern DataAttribute iedModel_Battery_ZBAT1_Vol_t;
extern DataObject iedModel_Battery_ZBAT1_Amp;
extern DataAttribute iedModel_Battery_ZBAT1_Amp_mag;
extern DataAttribute iedModel_Battery_ZBAT1_Amp_mag_f;
extern DataAttribute iedModel_Battery_ZBAT1_Amp_q;
extern DataAttribute iedModel_Battery_ZBAT1_Amp_t;
extern LogicalNode iedModel_Battery_ZBTC1;
extern DataObject iedModel_Battery_ZBTC1_Mod;
extern DataAttribute iedModel_Battery_ZBTC1_Mod_q;
extern DataAttribute iedModel_Battery_ZBTC1_Mod_t;
extern DataAttribute iedModel_Battery_ZBTC1_Mod_ctlModel;
extern DataObject iedModel_Battery_ZBTC1_Beh;
extern DataAttribute iedModel_Battery_ZBTC1_Beh_stVal;
extern DataAttribute iedModel_Battery_ZBTC1_Beh_q;
extern DataAttribute iedModel_Battery_ZBTC1_Beh_t;
extern DataObject iedModel_Battery_ZBTC1_Health;
extern DataAttribute iedModel_Battery_ZBTC1_Health_stVal;
extern DataAttribute iedModel_Battery_ZBTC1_Health_q;
extern DataAttribute iedModel_Battery_ZBTC1_Health_t;
extern DataObject iedModel_Battery_ZBTC1_NamPlt;
extern DataAttribute iedModel_Battery_ZBTC1_NamPlt_vendor;
extern DataAttribute iedModel_Battery_ZBTC1_NamPlt_swRev;
extern DataAttribute iedModel_Battery_ZBTC1_NamPlt_d;
extern DataObject iedModel_Battery_ZBTC1_BatChaSt;
extern DataObject iedModel_Battery_ZBTC1_BatChaPwr;
extern DataObject iedModel_Battery_ZBTC1_BatChaMod;
extern DataObject iedModel_Battery_ZBTC1_ChaV;
extern DataAttribute iedModel_Battery_ZBTC1_ChaV_mag;
extern DataAttribute iedModel_Battery_ZBTC1_ChaV_mag_f;
extern DataAttribute iedModel_Battery_ZBTC1_ChaV_q;
extern DataAttribute iedModel_Battery_ZBTC1_ChaV_t;
extern DataObject iedModel_Battery_ZBTC1_ChaA;
extern DataAttribute iedModel_Battery_ZBTC1_ChaA_mag;
extern DataAttribute iedModel_Battery_ZBTC1_ChaA_mag_f;
extern DataAttribute iedModel_Battery_ZBTC1_ChaA_q;
extern DataAttribute iedModel_Battery_ZBTC1_ChaA_t;
extern LogicalDevice iedModel_Physical_Measurements;
extern LogicalNode iedModel_Physical_Measurements_LLN0;
extern DataObject iedModel_Physical_Measurements_LLN0_Mod;
extern DataAttribute iedModel_Physical_Measurements_LLN0_Mod_q;
extern DataAttribute iedModel_Physical_Measurements_LLN0_Mod_t;
extern DataAttribute iedModel_Physical_Measurements_LLN0_Mod_ctlModel;
extern DataObject iedModel_Physical_Measurements_LLN0_Beh;
extern DataAttribute iedModel_Physical_Measurements_LLN0_Beh_stVal;
extern DataAttribute iedModel_Physical_Measurements_LLN0_Beh_q;
extern DataAttribute iedModel_Physical_Measurements_LLN0_Beh_t;
extern DataObject iedModel_Physical_Measurements_LLN0_Health;
extern DataAttribute iedModel_Physical_Measurements_LLN0_Health_stVal;
extern DataAttribute iedModel_Physical_Measurements_LLN0_Health_q;
extern DataAttribute iedModel_Physical_Measurements_LLN0_Health_t;
extern DataObject iedModel_Physical_Measurements_LLN0_NamPlt;
extern DataAttribute iedModel_Physical_Measurements_LLN0_NamPlt_vendor;
extern DataAttribute iedModel_Physical_Measurements_LLN0_NamPlt_swRev;
extern DataAttribute iedModel_Physical_Measurements_LLN0_NamPlt_d;
extern DataAttribute iedModel_Physical_Measurements_LLN0_NamPlt_configRev;
extern DataAttribute iedModel_Physical_Measurements_LLN0_NamPlt_ldNs;
extern LogicalNode iedModel_Physical_Measurements_LPHD1;
extern DataObject iedModel_Physical_Measurements_LPHD1_PhyNam;
extern DataAttribute iedModel_Physical_Measurements_LPHD1_PhyNam_vendor;
extern DataObject iedModel_Physical_Measurements_LPHD1_PhyHealth;
extern DataAttribute iedModel_Physical_Measurements_LPHD1_PhyHealth_stVal;
extern DataAttribute iedModel_Physical_Measurements_LPHD1_PhyHealth_q;
extern DataAttribute iedModel_Physical_Measurements_LPHD1_PhyHealth_t;
extern DataObject iedModel_Physical_Measurements_LPHD1_Proxy;
extern DataAttribute iedModel_Physical_Measurements_LPHD1_Proxy_stVal;
extern DataAttribute iedModel_Physical_Measurements_LPHD1_Proxy_q;
extern DataAttribute iedModel_Physical_Measurements_LPHD1_Proxy_t;
#define IEDMODEL_Inverter (&iedModel_Inverter)
#define IEDMODEL_Inverter_LLN0 (&iedModel_Inverter_LLN0)
#define IEDMODEL_Inverter_LLN0_Mod (&iedModel_Inverter_LLN0_Mod)
#define IEDMODEL_Inverter_LLN0_Mod_q (&iedModel_Inverter_LLN0_Mod_q)
#define IEDMODEL_Inverter_LLN0_Mod_t (&iedModel_Inverter_LLN0_Mod_t)
#define IEDMODEL_Inverter_LLN0_Mod_ctlModel (&iedModel_Inverter_LLN0_Mod_ctlModel)
#define IEDMODEL_Inverter_LLN0_Beh (&iedModel_Inverter_LLN0_Beh)
#define IEDMODEL_Inverter_LLN0_Beh_stVal (&iedModel_Inverter_LLN0_Beh_stVal)
#define IEDMODEL_Inverter_LLN0_Beh_q (&iedModel_Inverter_LLN0_Beh_q)
#define IEDMODEL_Inverter_LLN0_Beh_t (&iedModel_Inverter_LLN0_Beh_t)
#define IEDMODEL_Inverter_LLN0_Health (&iedModel_Inverter_LLN0_Health)
#define IEDMODEL_Inverter_LLN0_Health_stVal (&iedModel_Inverter_LLN0_Health_stVal)
#define IEDMODEL_Inverter_LLN0_Health_q (&iedModel_Inverter_LLN0_Health_q)
#define IEDMODEL_Inverter_LLN0_Health_t (&iedModel_Inverter_LLN0_Health_t)
#define IEDMODEL_Inverter_LLN0_NamPlt (&iedModel_Inverter_LLN0_NamPlt)
#define IEDMODEL_Inverter_LLN0_NamPlt_vendor (&iedModel_Inverter_LLN0_NamPlt_vendor)
#define IEDMODEL_Inverter_LLN0_NamPlt_swRev (&iedModel_Inverter_LLN0_NamPlt_swRev)
#define IEDMODEL_Inverter_LLN0_NamPlt_d (&iedModel_Inverter_LLN0_NamPlt_d)
#define IEDMODEL_Inverter_LLN0_NamPlt_configRev (&iedModel_Inverter_LLN0_NamPlt_configRev)
#define IEDMODEL_Inverter_LLN0_NamPlt_ldNs (&iedModel_Inverter_LLN0_NamPlt_ldNs)
#define IEDMODEL_Inverter_LPHD1 (&iedModel_Inverter_LPHD1)
#define IEDMODEL_Inverter_LPHD1_PhyNam (&iedModel_Inverter_LPHD1_PhyNam)
#define IEDMODEL_Inverter_LPHD1_PhyNam_vendor (&iedModel_Inverter_LPHD1_PhyNam_vendor)
#define IEDMODEL_Inverter_LPHD1_PhyHealth (&iedModel_Inverter_LPHD1_PhyHealth)
#define IEDMODEL_Inverter_LPHD1_PhyHealth_stVal (&iedModel_Inverter_LPHD1_PhyHealth_stVal)
#define IEDMODEL_Inverter_LPHD1_PhyHealth_q (&iedModel_Inverter_LPHD1_PhyHealth_q)
#define IEDMODEL_Inverter_LPHD1_PhyHealth_t (&iedModel_Inverter_LPHD1_PhyHealth_t)
#define IEDMODEL_Inverter_LPHD1_Proxy (&iedModel_Inverter_LPHD1_Proxy)
#define IEDMODEL_Inverter_LPHD1_Proxy_stVal (&iedModel_Inverter_LPHD1_Proxy_stVal)
#define IEDMODEL_Inverter_LPHD1_Proxy_q (&iedModel_Inverter_LPHD1_Proxy_q)
#define IEDMODEL_Inverter_LPHD1_Proxy_t (&iedModel_Inverter_LPHD1_Proxy_t)
#define IEDMODEL_Inverter_ZINV1 (&iedModel_Inverter_ZINV1)
#define IEDMODEL_Inverter_ZINV1_Mod (&iedModel_Inverter_ZINV1_Mod)
#define IEDMODEL_Inverter_ZINV1_Mod_q (&iedModel_Inverter_ZINV1_Mod_q)
#define IEDMODEL_Inverter_ZINV1_Mod_t (&iedModel_Inverter_ZINV1_Mod_t)
#define IEDMODEL_Inverter_ZINV1_Mod_ctlModel (&iedModel_Inverter_ZINV1_Mod_ctlModel)
#define IEDMODEL_Inverter_ZINV1_Beh (&iedModel_Inverter_ZINV1_Beh)
#define IEDMODEL_Inverter_ZINV1_Beh_stVal (&iedModel_Inverter_ZINV1_Beh_stVal)
#define IEDMODEL_Inverter_ZINV1_Beh_q (&iedModel_Inverter_ZINV1_Beh_q)
#define IEDMODEL_Inverter_ZINV1_Beh_t (&iedModel_Inverter_ZINV1_Beh_t)
#define IEDMODEL_Inverter_ZINV1_Health (&iedModel_Inverter_ZINV1_Health)
#define IEDMODEL_Inverter_ZINV1_Health_stVal (&iedModel_Inverter_ZINV1_Health_stVal)
#define IEDMODEL_Inverter_ZINV1_Health_q (&iedModel_Inverter_ZINV1_Health_q)
#define IEDMODEL_Inverter_ZINV1_Health_t (&iedModel_Inverter_ZINV1_Health_t)
#define IEDMODEL_Inverter_ZINV1_NamPlt (&iedModel_Inverter_ZINV1_NamPlt)
#define IEDMODEL_Inverter_ZINV1_NamPlt_vendor (&iedModel_Inverter_ZINV1_NamPlt_vendor)
#define IEDMODEL_Inverter_ZINV1_NamPlt_swRev (&iedModel_Inverter_ZINV1_NamPlt_swRev)
#define IEDMODEL_Inverter_ZINV1_NamPlt_d (&iedModel_Inverter_ZINV1_NamPlt_d)
#define IEDMODEL_Inverter_ZINV1_WRtg (&iedModel_Inverter_ZINV1_WRtg)
#define IEDMODEL_Inverter_ZINV1_WRtg_setMag (&iedModel_Inverter_ZINV1_WRtg_setMag)
#define IEDMODEL_Inverter_ZINV1_WRtg_setMag_f (&iedModel_Inverter_ZINV1_WRtg_setMag_f)
#define IEDMODEL_Inverter_ZINV1_WRtg_units (&iedModel_Inverter_ZINV1_WRtg_units)
#define IEDMODEL_Inverter_ZINV1_WRtg_units_SIUnit (&iedModel_Inverter_ZINV1_WRtg_units_SIUnit)
#define IEDMODEL_Inverter_ZINV1_VarRtg (&iedModel_Inverter_ZINV1_VarRtg)
#define IEDMODEL_Inverter_ZINV1_VarRtg_setMag (&iedModel_Inverter_ZINV1_VarRtg_setMag)
#define IEDMODEL_Inverter_ZINV1_VarRtg_setMag_f (&iedModel_Inverter_ZINV1_VarRtg_setMag_f)
#define IEDMODEL_Inverter_ZINV1_VarRtg_units (&iedModel_Inverter_ZINV1_VarRtg_units)
#define IEDMODEL_Inverter_ZINV1_VarRtg_units_SIUnit (&iedModel_Inverter_ZINV1_VarRtg_units_SIUnit)
#define IEDMODEL_Inverter_ZINV1_ACTyp (&iedModel_Inverter_ZINV1_ACTyp)
#define IEDMODEL_Inverter_ZINV1_ACTyp_setVal (&iedModel_Inverter_ZINV1_ACTyp_setVal)
#define IEDMODEL_Inverter_ZINV1_OutWSet (&iedModel_Inverter_ZINV1_OutWSet)
#define IEDMODEL_Inverter_ZINV1_OutWSet_setMag (&iedModel_Inverter_ZINV1_OutWSet_setMag)
#define IEDMODEL_Inverter_ZINV1_OutWSet_setMag_f (&iedModel_Inverter_ZINV1_OutWSet_setMag_f)
#define IEDMODEL_Inverter_ZINV1_OutWSet_units (&iedModel_Inverter_ZINV1_OutWSet_units)
#define IEDMODEL_Inverter_ZINV1_OutWSet_units_SIUnit (&iedModel_Inverter_ZINV1_OutWSet_units_SIUnit)
#define IEDMODEL_Inverter_ZINV1_OutVarSet (&iedModel_Inverter_ZINV1_OutVarSet)
#define IEDMODEL_Inverter_ZINV1_OutVarSet_setMag (&iedModel_Inverter_ZINV1_OutVarSet_setMag)
#define IEDMODEL_Inverter_ZINV1_OutVarSet_setMag_f (&iedModel_Inverter_ZINV1_OutVarSet_setMag_f)
#define IEDMODEL_Inverter_ZINV1_OutVarSet_units (&iedModel_Inverter_ZINV1_OutVarSet_units)
#define IEDMODEL_Inverter_ZINV1_OutVarSet_units_SIUnit (&iedModel_Inverter_ZINV1_OutVarSet_units_SIUnit)
#define IEDMODEL_Inverter_MMXU1 (&iedModel_Inverter_MMXU1)
#define IEDMODEL_Inverter_MMXU1_Mod (&iedModel_Inverter_MMXU1_Mod)
#define IEDMODEL_Inverter_MMXU1_Mod_q (&iedModel_Inverter_MMXU1_Mod_q)
#define IEDMODEL_Inverter_MMXU1_Mod_t (&iedModel_Inverter_MMXU1_Mod_t)
#define IEDMODEL_Inverter_MMXU1_Mod_ctlModel (&iedModel_Inverter_MMXU1_Mod_ctlModel)
#define IEDMODEL_Inverter_MMXU1_Beh (&iedModel_Inverter_MMXU1_Beh)
#define IEDMODEL_Inverter_MMXU1_Beh_stVal (&iedModel_Inverter_MMXU1_Beh_stVal)
#define IEDMODEL_Inverter_MMXU1_Beh_q (&iedModel_Inverter_MMXU1_Beh_q)
#define IEDMODEL_Inverter_MMXU1_Beh_t (&iedModel_Inverter_MMXU1_Beh_t)
#define IEDMODEL_Inverter_MMXU1_Health (&iedModel_Inverter_MMXU1_Health)
#define IEDMODEL_Inverter_MMXU1_Health_stVal (&iedModel_Inverter_MMXU1_Health_stVal)
#define IEDMODEL_Inverter_MMXU1_Health_q (&iedModel_Inverter_MMXU1_Health_q)
#define IEDMODEL_Inverter_MMXU1_Health_t (&iedModel_Inverter_MMXU1_Health_t)
#define IEDMODEL_Inverter_MMXU1_NamPlt (&iedModel_Inverter_MMXU1_NamPlt)
#define IEDMODEL_Inverter_MMXU1_NamPlt_vendor (&iedModel_Inverter_MMXU1_NamPlt_vendor)
#define IEDMODEL_Inverter_MMXU1_NamPlt_swRev (&iedModel_Inverter_MMXU1_NamPlt_swRev)
#define IEDMODEL_Inverter_MMXU1_NamPlt_d (&iedModel_Inverter_MMXU1_NamPlt_d)
#define IEDMODEL_Inverter_MMXU1_TotW (&iedModel_Inverter_MMXU1_TotW)
#define IEDMODEL_Inverter_MMXU1_TotW_mag (&iedModel_Inverter_MMXU1_TotW_mag)
#define IEDMODEL_Inverter_MMXU1_TotW_mag_f (&iedModel_Inverter_MMXU1_TotW_mag_f)
#define IEDMODEL_Inverter_MMXU1_TotW_q (&iedModel_Inverter_MMXU1_TotW_q)
#define IEDMODEL_Inverter_MMXU1_TotW_t (&iedModel_Inverter_MMXU1_TotW_t)
#define IEDMODEL_Inverter_MMXU1_TotVAr (&iedModel_Inverter_MMXU1_TotVAr)
#define IEDMODEL_Inverter_MMXU1_TotVAr_mag (&iedModel_Inverter_MMXU1_TotVAr_mag)
#define IEDMODEL_Inverter_MMXU1_TotVAr_mag_f (&iedModel_Inverter_MMXU1_TotVAr_mag_f)
#define IEDMODEL_Inverter_MMXU1_TotVAr_q (&iedModel_Inverter_MMXU1_TotVAr_q)
#define IEDMODEL_Inverter_MMXU1_TotVAr_t (&iedModel_Inverter_MMXU1_TotVAr_t)
#define IEDMODEL_Inverter_MMXU1_TotVA (&iedModel_Inverter_MMXU1_TotVA)
#define IEDMODEL_Inverter_MMXU1_TotVA_mag (&iedModel_Inverter_MMXU1_TotVA_mag)
#define IEDMODEL_Inverter_MMXU1_TotVA_mag_f (&iedModel_Inverter_MMXU1_TotVA_mag_f)
#define IEDMODEL_Inverter_MMXU1_TotVA_q (&iedModel_Inverter_MMXU1_TotVA_q)
#define IEDMODEL_Inverter_MMXU1_TotVA_t (&iedModel_Inverter_MMXU1_TotVA_t)
#define IEDMODEL_Inverter_MMXU1_Hz (&iedModel_Inverter_MMXU1_Hz)
#define IEDMODEL_Inverter_MMXU1_Hz_mag (&iedModel_Inverter_MMXU1_Hz_mag)
#define IEDMODEL_Inverter_MMXU1_Hz_mag_f (&iedModel_Inverter_MMXU1_Hz_mag_f)
#define IEDMODEL_Inverter_MMXU1_Hz_q (&iedModel_Inverter_MMXU1_Hz_q)
#define IEDMODEL_Inverter_MMXU1_Hz_t (&iedModel_Inverter_MMXU1_Hz_t)
#define IEDMODEL_Inverter_MMXU1_PhV (&iedModel_Inverter_MMXU1_PhV)
#define IEDMODEL_Inverter_MMXU1_PhV_phsA (&iedModel_Inverter_MMXU1_PhV_phsA)
#define IEDMODEL_Inverter_MMXU1_PhV_phsA_cVal (&iedModel_Inverter_MMXU1_PhV_phsA_cVal)
#define IEDMODEL_Inverter_MMXU1_PhV_phsA_cVal_mag (&iedModel_Inverter_MMXU1_PhV_phsA_cVal_mag)
#define IEDMODEL_Inverter_MMXU1_PhV_phsA_cVal_mag_f (&iedModel_Inverter_MMXU1_PhV_phsA_cVal_mag_f)
#define IEDMODEL_Inverter_MMXU1_PhV_phsA_q (&iedModel_Inverter_MMXU1_PhV_phsA_q)
#define IEDMODEL_Inverter_MMXU1_PhV_phsA_t (&iedModel_Inverter_MMXU1_PhV_phsA_t)
#define IEDMODEL_Inverter_MMXU1_PhV_phsB (&iedModel_Inverter_MMXU1_PhV_phsB)
#define IEDMODEL_Inverter_MMXU1_PhV_phsB_cVal (&iedModel_Inverter_MMXU1_PhV_phsB_cVal)
#define IEDMODEL_Inverter_MMXU1_PhV_phsB_cVal_mag (&iedModel_Inverter_MMXU1_PhV_phsB_cVal_mag)
#define IEDMODEL_Inverter_MMXU1_PhV_phsB_cVal_mag_f (&iedModel_Inverter_MMXU1_PhV_phsB_cVal_mag_f)
#define IEDMODEL_Inverter_MMXU1_PhV_phsB_q (&iedModel_Inverter_MMXU1_PhV_phsB_q)
#define IEDMODEL_Inverter_MMXU1_PhV_phsB_t (&iedModel_Inverter_MMXU1_PhV_phsB_t)
#define IEDMODEL_Inverter_MMXU1_PhV_phsC (&iedModel_Inverter_MMXU1_PhV_phsC)
#define IEDMODEL_Inverter_MMXU1_PhV_phsC_cVal (&iedModel_Inverter_MMXU1_PhV_phsC_cVal)
#define IEDMODEL_Inverter_MMXU1_PhV_phsC_cVal_mag (&iedModel_Inverter_MMXU1_PhV_phsC_cVal_mag)
#define IEDMODEL_Inverter_MMXU1_PhV_phsC_cVal_mag_f (&iedModel_Inverter_MMXU1_PhV_phsC_cVal_mag_f)
#define IEDMODEL_Inverter_MMXU1_PhV_phsC_q (&iedModel_Inverter_MMXU1_PhV_phsC_q)
#define IEDMODEL_Inverter_MMXU1_PhV_phsC_t (&iedModel_Inverter_MMXU1_PhV_phsC_t)
#define IEDMODEL_Inverter_MMXU1_PhV_neut (&iedModel_Inverter_MMXU1_PhV_neut)
#define IEDMODEL_Inverter_MMXU1_PhV_neut_cVal (&iedModel_Inverter_MMXU1_PhV_neut_cVal)
#define IEDMODEL_Inverter_MMXU1_PhV_neut_cVal_mag (&iedModel_Inverter_MMXU1_PhV_neut_cVal_mag)
#define IEDMODEL_Inverter_MMXU1_PhV_neut_cVal_mag_f (&iedModel_Inverter_MMXU1_PhV_neut_cVal_mag_f)
#define IEDMODEL_Inverter_MMXU1_PhV_neut_q (&iedModel_Inverter_MMXU1_PhV_neut_q)
#define IEDMODEL_Inverter_MMXU1_PhV_neut_t (&iedModel_Inverter_MMXU1_PhV_neut_t)
#define IEDMODEL_Inverter_MMXU1_A (&iedModel_Inverter_MMXU1_A)
#define IEDMODEL_Inverter_MMXU1_A_phsA (&iedModel_Inverter_MMXU1_A_phsA)
#define IEDMODEL_Inverter_MMXU1_A_phsA_cVal (&iedModel_Inverter_MMXU1_A_phsA_cVal)
#define IEDMODEL_Inverter_MMXU1_A_phsA_cVal_mag (&iedModel_Inverter_MMXU1_A_phsA_cVal_mag)
#define IEDMODEL_Inverter_MMXU1_A_phsA_cVal_mag_f (&iedModel_Inverter_MMXU1_A_phsA_cVal_mag_f)
#define IEDMODEL_Inverter_MMXU1_A_phsA_q (&iedModel_Inverter_MMXU1_A_phsA_q)
#define IEDMODEL_Inverter_MMXU1_A_phsA_t (&iedModel_Inverter_MMXU1_A_phsA_t)
#define IEDMODEL_Inverter_MMXU1_A_phsB (&iedModel_Inverter_MMXU1_A_phsB)
#define IEDMODEL_Inverter_MMXU1_A_phsB_cVal (&iedModel_Inverter_MMXU1_A_phsB_cVal)
#define IEDMODEL_Inverter_MMXU1_A_phsB_cVal_mag (&iedModel_Inverter_MMXU1_A_phsB_cVal_mag)
#define IEDMODEL_Inverter_MMXU1_A_phsB_cVal_mag_f (&iedModel_Inverter_MMXU1_A_phsB_cVal_mag_f)
#define IEDMODEL_Inverter_MMXU1_A_phsB_q (&iedModel_Inverter_MMXU1_A_phsB_q)
#define IEDMODEL_Inverter_MMXU1_A_phsB_t (&iedModel_Inverter_MMXU1_A_phsB_t)
#define IEDMODEL_Inverter_MMXU1_A_phsC (&iedModel_Inverter_MMXU1_A_phsC)
#define IEDMODEL_Inverter_MMXU1_A_phsC_cVal (&iedModel_Inverter_MMXU1_A_phsC_cVal)
#define IEDMODEL_Inverter_MMXU1_A_phsC_cVal_mag (&iedModel_Inverter_MMXU1_A_phsC_cVal_mag)
#define IEDMODEL_Inverter_MMXU1_A_phsC_cVal_mag_f (&iedModel_Inverter_MMXU1_A_phsC_cVal_mag_f)
#define IEDMODEL_Inverter_MMXU1_A_phsC_q (&iedModel_Inverter_MMXU1_A_phsC_q)
#define IEDMODEL_Inverter_MMXU1_A_phsC_t (&iedModel_Inverter_MMXU1_A_phsC_t)
#define IEDMODEL_Inverter_MMXU1_A_neut (&iedModel_Inverter_MMXU1_A_neut)
#define IEDMODEL_Inverter_MMXU1_A_neut_cVal (&iedModel_Inverter_MMXU1_A_neut_cVal)
#define IEDMODEL_Inverter_MMXU1_A_neut_cVal_mag (&iedModel_Inverter_MMXU1_A_neut_cVal_mag)
#define IEDMODEL_Inverter_MMXU1_A_neut_cVal_mag_f (&iedModel_Inverter_MMXU1_A_neut_cVal_mag_f)
#define IEDMODEL_Inverter_MMXU1_A_neut_q (&iedModel_Inverter_MMXU1_A_neut_q)
#define IEDMODEL_Inverter_MMXU1_A_neut_t (&iedModel_Inverter_MMXU1_A_neut_t)
#define IEDMODEL_Inverter_MMXU1_W (&iedModel_Inverter_MMXU1_W)
#define IEDMODEL_Inverter_MMXU1_W_phsA (&iedModel_Inverter_MMXU1_W_phsA)
#define IEDMODEL_Inverter_MMXU1_W_phsA_cVal (&iedModel_Inverter_MMXU1_W_phsA_cVal)
#define IEDMODEL_Inverter_MMXU1_W_phsA_cVal_mag (&iedModel_Inverter_MMXU1_W_phsA_cVal_mag)
#define IEDMODEL_Inverter_MMXU1_W_phsA_cVal_mag_f (&iedModel_Inverter_MMXU1_W_phsA_cVal_mag_f)
#define IEDMODEL_Inverter_MMXU1_W_phsA_q (&iedModel_Inverter_MMXU1_W_phsA_q)
#define IEDMODEL_Inverter_MMXU1_W_phsA_t (&iedModel_Inverter_MMXU1_W_phsA_t)
#define IEDMODEL_Inverter_MMXU1_W_phsB (&iedModel_Inverter_MMXU1_W_phsB)
#define IEDMODEL_Inverter_MMXU1_W_phsB_cVal (&iedModel_Inverter_MMXU1_W_phsB_cVal)
#define IEDMODEL_Inverter_MMXU1_W_phsB_cVal_mag (&iedModel_Inverter_MMXU1_W_phsB_cVal_mag)
#define IEDMODEL_Inverter_MMXU1_W_phsB_cVal_mag_f (&iedModel_Inverter_MMXU1_W_phsB_cVal_mag_f)
#define IEDMODEL_Inverter_MMXU1_W_phsB_q (&iedModel_Inverter_MMXU1_W_phsB_q)
#define IEDMODEL_Inverter_MMXU1_W_phsB_t (&iedModel_Inverter_MMXU1_W_phsB_t)
#define IEDMODEL_Inverter_MMXU1_W_phsC (&iedModel_Inverter_MMXU1_W_phsC)
#define IEDMODEL_Inverter_MMXU1_W_phsC_cVal (&iedModel_Inverter_MMXU1_W_phsC_cVal)
#define IEDMODEL_Inverter_MMXU1_W_phsC_cVal_mag (&iedModel_Inverter_MMXU1_W_phsC_cVal_mag)
#define IEDMODEL_Inverter_MMXU1_W_phsC_cVal_mag_f (&iedModel_Inverter_MMXU1_W_phsC_cVal_mag_f)
#define IEDMODEL_Inverter_MMXU1_W_phsC_q (&iedModel_Inverter_MMXU1_W_phsC_q)
#define IEDMODEL_Inverter_MMXU1_W_phsC_t (&iedModel_Inverter_MMXU1_W_phsC_t)
#define IEDMODEL_Battery (&iedModel_Battery)
#define IEDMODEL_Battery_LLN0 (&iedModel_Battery_LLN0)
#define IEDMODEL_Battery_LLN0_Mod (&iedModel_Battery_LLN0_Mod)
#define IEDMODEL_Battery_LLN0_Mod_q (&iedModel_Battery_LLN0_Mod_q)
#define IEDMODEL_Battery_LLN0_Mod_t (&iedModel_Battery_LLN0_Mod_t)
#define IEDMODEL_Battery_LLN0_Mod_ctlModel (&iedModel_Battery_LLN0_Mod_ctlModel)
#define IEDMODEL_Battery_LLN0_Beh (&iedModel_Battery_LLN0_Beh)
#define IEDMODEL_Battery_LLN0_Beh_stVal (&iedModel_Battery_LLN0_Beh_stVal)
#define IEDMODEL_Battery_LLN0_Beh_q (&iedModel_Battery_LLN0_Beh_q)
#define IEDMODEL_Battery_LLN0_Beh_t (&iedModel_Battery_LLN0_Beh_t)
#define IEDMODEL_Battery_LLN0_Health (&iedModel_Battery_LLN0_Health)
#define IEDMODEL_Battery_LLN0_Health_stVal (&iedModel_Battery_LLN0_Health_stVal)
#define IEDMODEL_Battery_LLN0_Health_q (&iedModel_Battery_LLN0_Health_q)
#define IEDMODEL_Battery_LLN0_Health_t (&iedModel_Battery_LLN0_Health_t)
#define IEDMODEL_Battery_LLN0_NamPlt (&iedModel_Battery_LLN0_NamPlt)
#define IEDMODEL_Battery_LLN0_NamPlt_vendor (&iedModel_Battery_LLN0_NamPlt_vendor)
#define IEDMODEL_Battery_LLN0_NamPlt_swRev (&iedModel_Battery_LLN0_NamPlt_swRev)
#define IEDMODEL_Battery_LLN0_NamPlt_d (&iedModel_Battery_LLN0_NamPlt_d)
#define IEDMODEL_Battery_LLN0_NamPlt_configRev (&iedModel_Battery_LLN0_NamPlt_configRev)
#define IEDMODEL_Battery_LLN0_NamPlt_ldNs (&iedModel_Battery_LLN0_NamPlt_ldNs)
#define IEDMODEL_Battery_LPHD1 (&iedModel_Battery_LPHD1)
#define IEDMODEL_Battery_LPHD1_PhyNam (&iedModel_Battery_LPHD1_PhyNam)
#define IEDMODEL_Battery_LPHD1_PhyNam_vendor (&iedModel_Battery_LPHD1_PhyNam_vendor)
#define IEDMODEL_Battery_LPHD1_PhyHealth (&iedModel_Battery_LPHD1_PhyHealth)
#define IEDMODEL_Battery_LPHD1_PhyHealth_stVal (&iedModel_Battery_LPHD1_PhyHealth_stVal)
#define IEDMODEL_Battery_LPHD1_PhyHealth_q (&iedModel_Battery_LPHD1_PhyHealth_q)
#define IEDMODEL_Battery_LPHD1_PhyHealth_t (&iedModel_Battery_LPHD1_PhyHealth_t)
#define IEDMODEL_Battery_LPHD1_Proxy (&iedModel_Battery_LPHD1_Proxy)
#define IEDMODEL_Battery_LPHD1_Proxy_stVal (&iedModel_Battery_LPHD1_Proxy_stVal)
#define IEDMODEL_Battery_LPHD1_Proxy_q (&iedModel_Battery_LPHD1_Proxy_q)
#define IEDMODEL_Battery_LPHD1_Proxy_t (&iedModel_Battery_LPHD1_Proxy_t)
#define IEDMODEL_Battery_ZBAT1 (&iedModel_Battery_ZBAT1)
#define IEDMODEL_Battery_ZBAT1_Mod (&iedModel_Battery_ZBAT1_Mod)
#define IEDMODEL_Battery_ZBAT1_Mod_q (&iedModel_Battery_ZBAT1_Mod_q)
#define IEDMODEL_Battery_ZBAT1_Mod_t (&iedModel_Battery_ZBAT1_Mod_t)
#define IEDMODEL_Battery_ZBAT1_Mod_ctlModel (&iedModel_Battery_ZBAT1_Mod_ctlModel)
#define IEDMODEL_Battery_ZBAT1_Beh (&iedModel_Battery_ZBAT1_Beh)
#define IEDMODEL_Battery_ZBAT1_Beh_stVal (&iedModel_Battery_ZBAT1_Beh_stVal)
#define IEDMODEL_Battery_ZBAT1_Beh_q (&iedModel_Battery_ZBAT1_Beh_q)
#define IEDMODEL_Battery_ZBAT1_Beh_t (&iedModel_Battery_ZBAT1_Beh_t)
#define IEDMODEL_Battery_ZBAT1_Health (&iedModel_Battery_ZBAT1_Health)
#define IEDMODEL_Battery_ZBAT1_Health_stVal (&iedModel_Battery_ZBAT1_Health_stVal)
#define IEDMODEL_Battery_ZBAT1_Health_q (&iedModel_Battery_ZBAT1_Health_q)
#define IEDMODEL_Battery_ZBAT1_Health_t (&iedModel_Battery_ZBAT1_Health_t)
#define IEDMODEL_Battery_ZBAT1_NamPlt (&iedModel_Battery_ZBAT1_NamPlt)
#define IEDMODEL_Battery_ZBAT1_NamPlt_vendor (&iedModel_Battery_ZBAT1_NamPlt_vendor)
#define IEDMODEL_Battery_ZBAT1_NamPlt_swRev (&iedModel_Battery_ZBAT1_NamPlt_swRev)
#define IEDMODEL_Battery_ZBAT1_NamPlt_d (&iedModel_Battery_ZBAT1_NamPlt_d)
#define IEDMODEL_Battery_ZBAT1_Vol (&iedModel_Battery_ZBAT1_Vol)
#define IEDMODEL_Battery_ZBAT1_Vol_mag (&iedModel_Battery_ZBAT1_Vol_mag)
#define IEDMODEL_Battery_ZBAT1_Vol_mag_f (&iedModel_Battery_ZBAT1_Vol_mag_f)
#define IEDMODEL_Battery_ZBAT1_Vol_q (&iedModel_Battery_ZBAT1_Vol_q)
#define IEDMODEL_Battery_ZBAT1_Vol_t (&iedModel_Battery_ZBAT1_Vol_t)
#define IEDMODEL_Battery_ZBAT1_Amp (&iedModel_Battery_ZBAT1_Amp)
#define IEDMODEL_Battery_ZBAT1_Amp_mag (&iedModel_Battery_ZBAT1_Amp_mag)
#define IEDMODEL_Battery_ZBAT1_Amp_mag_f (&iedModel_Battery_ZBAT1_Amp_mag_f)
#define IEDMODEL_Battery_ZBAT1_Amp_q (&iedModel_Battery_ZBAT1_Amp_q)
#define IEDMODEL_Battery_ZBAT1_Amp_t (&iedModel_Battery_ZBAT1_Amp_t)
#define IEDMODEL_Battery_ZBTC1 (&iedModel_Battery_ZBTC1)
#define IEDMODEL_Battery_ZBTC1_Mod (&iedModel_Battery_ZBTC1_Mod)
#define IEDMODEL_Battery_ZBTC1_Mod_q (&iedModel_Battery_ZBTC1_Mod_q)
#define IEDMODEL_Battery_ZBTC1_Mod_t (&iedModel_Battery_ZBTC1_Mod_t)
#define IEDMODEL_Battery_ZBTC1_Mod_ctlModel (&iedModel_Battery_ZBTC1_Mod_ctlModel)
#define IEDMODEL_Battery_ZBTC1_Beh (&iedModel_Battery_ZBTC1_Beh)
#define IEDMODEL_Battery_ZBTC1_Beh_stVal (&iedModel_Battery_ZBTC1_Beh_stVal)
#define IEDMODEL_Battery_ZBTC1_Beh_q (&iedModel_Battery_ZBTC1_Beh_q)
#define IEDMODEL_Battery_ZBTC1_Beh_t (&iedModel_Battery_ZBTC1_Beh_t)
#define IEDMODEL_Battery_ZBTC1_Health (&iedModel_Battery_ZBTC1_Health)
#define IEDMODEL_Battery_ZBTC1_Health_stVal (&iedModel_Battery_ZBTC1_Health_stVal)
#define IEDMODEL_Battery_ZBTC1_Health_q (&iedModel_Battery_ZBTC1_Health_q)
#define IEDMODEL_Battery_ZBTC1_Health_t (&iedModel_Battery_ZBTC1_Health_t)
#define IEDMODEL_Battery_ZBTC1_NamPlt (&iedModel_Battery_ZBTC1_NamPlt)
#define IEDMODEL_Battery_ZBTC1_NamPlt_vendor (&iedModel_Battery_ZBTC1_NamPlt_vendor)
#define IEDMODEL_Battery_ZBTC1_NamPlt_swRev (&iedModel_Battery_ZBTC1_NamPlt_swRev)
#define IEDMODEL_Battery_ZBTC1_NamPlt_d (&iedModel_Battery_ZBTC1_NamPlt_d)
#define IEDMODEL_Battery_ZBTC1_BatChaSt (&iedModel_Battery_ZBTC1_BatChaSt)
#define IEDMODEL_Battery_ZBTC1_BatChaPwr (&iedModel_Battery_ZBTC1_BatChaPwr)
#define IEDMODEL_Battery_ZBTC1_BatChaMod (&iedModel_Battery_ZBTC1_BatChaMod)
#define IEDMODEL_Battery_ZBTC1_ChaV (&iedModel_Battery_ZBTC1_ChaV)
#define IEDMODEL_Battery_ZBTC1_ChaV_mag (&iedModel_Battery_ZBTC1_ChaV_mag)
#define IEDMODEL_Battery_ZBTC1_ChaV_mag_f (&iedModel_Battery_ZBTC1_ChaV_mag_f)
#define IEDMODEL_Battery_ZBTC1_ChaV_q (&iedModel_Battery_ZBTC1_ChaV_q)
#define IEDMODEL_Battery_ZBTC1_ChaV_t (&iedModel_Battery_ZBTC1_ChaV_t)
#define IEDMODEL_Battery_ZBTC1_ChaA (&iedModel_Battery_ZBTC1_ChaA)
#define IEDMODEL_Battery_ZBTC1_ChaA_mag (&iedModel_Battery_ZBTC1_ChaA_mag)
#define IEDMODEL_Battery_ZBTC1_ChaA_mag_f (&iedModel_Battery_ZBTC1_ChaA_mag_f)
#define IEDMODEL_Battery_ZBTC1_ChaA_q (&iedModel_Battery_ZBTC1_ChaA_q)
#define IEDMODEL_Battery_ZBTC1_ChaA_t (&iedModel_Battery_ZBTC1_ChaA_t)
#define IEDMODEL_Physical_Measurements (&iedModel_Physical_Measurements)
#define IEDMODEL_Physical_Measurements_LLN0 (&iedModel_Physical_Measurements_LLN0)
#define IEDMODEL_Physical_Measurements_LLN0_Mod (&iedModel_Physical_Measurements_LLN0_Mod)
#define IEDMODEL_Physical_Measurements_LLN0_Mod_q (&iedModel_Physical_Measurements_LLN0_Mod_q)
#define IEDMODEL_Physical_Measurements_LLN0_Mod_t (&iedModel_Physical_Measurements_LLN0_Mod_t)
#define IEDMODEL_Physical_Measurements_LLN0_Mod_ctlModel (&iedModel_Physical_Measurements_LLN0_Mod_ctlModel)
#define IEDMODEL_Physical_Measurements_LLN0_Beh (&iedModel_Physical_Measurements_LLN0_Beh)
#define IEDMODEL_Physical_Measurements_LLN0_Beh_stVal (&iedModel_Physical_Measurements_LLN0_Beh_stVal)
#define IEDMODEL_Physical_Measurements_LLN0_Beh_q (&iedModel_Physical_Measurements_LLN0_Beh_q)
#define IEDMODEL_Physical_Measurements_LLN0_Beh_t (&iedModel_Physical_Measurements_LLN0_Beh_t)
#define IEDMODEL_Physical_Measurements_LLN0_Health (&iedModel_Physical_Measurements_LLN0_Health)
#define IEDMODEL_Physical_Measurements_LLN0_Health_stVal (&iedModel_Physical_Measurements_LLN0_Health_stVal)
#define IEDMODEL_Physical_Measurements_LLN0_Health_q (&iedModel_Physical_Measurements_LLN0_Health_q)
#define IEDMODEL_Physical_Measurements_LLN0_Health_t (&iedModel_Physical_Measurements_LLN0_Health_t)
#define IEDMODEL_Physical_Measurements_LLN0_NamPlt (&iedModel_Physical_Measurements_LLN0_NamPlt)
#define IEDMODEL_Physical_Measurements_LLN0_NamPlt_vendor (&iedModel_Physical_Measurements_LLN0_NamPlt_vendor)
#define IEDMODEL_Physical_Measurements_LLN0_NamPlt_swRev (&iedModel_Physical_Measurements_LLN0_NamPlt_swRev)
#define IEDMODEL_Physical_Measurements_LLN0_NamPlt_d (&iedModel_Physical_Measurements_LLN0_NamPlt_d)
#define IEDMODEL_Physical_Measurements_LLN0_NamPlt_configRev (&iedModel_Physical_Measurements_LLN0_NamPlt_configRev)
#define IEDMODEL_Physical_Measurements_LLN0_NamPlt_ldNs (&iedModel_Physical_Measurements_LLN0_NamPlt_ldNs)
#define IEDMODEL_Physical_Measurements_LPHD1 (&iedModel_Physical_Measurements_LPHD1)
#define IEDMODEL_Physical_Measurements_LPHD1_PhyNam (&iedModel_Physical_Measurements_LPHD1_PhyNam)
#define IEDMODEL_Physical_Measurements_LPHD1_PhyNam_vendor (&iedModel_Physical_Measurements_LPHD1_PhyNam_vendor)
#define IEDMODEL_Physical_Measurements_LPHD1_PhyHealth (&iedModel_Physical_Measurements_LPHD1_PhyHealth)
#define IEDMODEL_Physical_Measurements_LPHD1_PhyHealth_stVal (&iedModel_Physical_Measurements_LPHD1_PhyHealth_stVal)
#define IEDMODEL_Physical_Measurements_LPHD1_PhyHealth_q (&iedModel_Physical_Measurements_LPHD1_PhyHealth_q)
#define IEDMODEL_Physical_Measurements_LPHD1_PhyHealth_t (&iedModel_Physical_Measurements_LPHD1_PhyHealth_t)
#define IEDMODEL_Physical_Measurements_LPHD1_Proxy (&iedModel_Physical_Measurements_LPHD1_Proxy)
#define IEDMODEL_Physical_Measurements_LPHD1_Proxy_stVal (&iedModel_Physical_Measurements_LPHD1_Proxy_stVal)
#define IEDMODEL_Physical_Measurements_LPHD1_Proxy_q (&iedModel_Physical_Measurements_LPHD1_Proxy_q)
#define IEDMODEL_Physical_Measurements_LPHD1_Proxy_t (&iedModel_Physical_Measurements_LPHD1_Proxy_t)
#endif /* STATIC_MODEL_H_ */

@ -0,0 +1,21 @@
include_directories(
.
)
set(server_example_SRCS
server_example_basic_io.c
static_model.c
)
IF(WIN32)
set_source_files_properties(${server_example_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(WIN32)
add_executable(server_example_basic_io
${server_example_SRCS}
)
target_link_libraries(server_example_basic_io
iec61850
)

@ -0,0 +1,31 @@
LIBIEC_HOME=../..
PROJECT_BINARY_NAME = server_example_basic_io
PROJECT_SOURCES = server_example_basic_io.c
PROJECT_SOURCES += static_model.c
PROJECT_ICD_FILE = simpleIO_direct_control.icd
include $(LIBIEC_HOME)/make/target_system.mk
include $(LIBIEC_HOME)/make/stack_includes.mk
all: $(PROJECT_BINARY_NAME)
include $(LIBIEC_HOME)/make/common_targets.mk
LDLIBS += -lm
CP = cp
model: $(PROJECT_ICD_FILE)
java -jar $(LIBIEC_HOME)/tools/model_generator/genmodel.jar $(PROJECT_ICD_FILE)
$(PROJECT_BINARY_NAME): $(PROJECT_SOURCES) $(LIB_NAME)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(PROJECT_BINARY_NAME) $(PROJECT_SOURCES) $(INCLUDES) $(LIB_NAME) $(LDLIBS)
$(CP) $(PROJECT_BINARY_NAME) vmd-filestore/IEDSERVER.BIN
clean:
rm -f $(PROJECT_BINARY_NAME)
rm -f vmd-filestore/IEDSERVER.BIN

@ -1,5 +1,5 @@
/*
* server_example3.c
* server_example_basic_io.c
*
* - How to use simple control models
* - How to serve analog measurement data
@ -12,7 +12,7 @@
#include <stdio.h>
#include <math.h>
#include "static_model.h"
#include "../server_example_basic_io/static_model.h"
/* import IEC 61850 device model created from SCL-File */
extern IedModel iedModel;
@ -85,6 +85,10 @@ main(int argc, char** argv)
iedServer = IedServer_create(&iedModel);
/* Set the base path for the MMS file services */
MmsServer mmsServer = IedServer_getMmsServer(iedServer);
MmsServer_setFilestoreBasepath(mmsServer, "./vmd-filestore/");
/* Install handler for operate command */
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1,
(ControlHandler) controlHandlerForBinaryOutput,

File diff suppressed because it is too large Load Diff

@ -0,0 +1,21 @@
include_directories(
.
)
set(server_example_SRCS
server_example_files.c
static_model.c
)
IF(WIN32)
set_source_files_properties(${server_example_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(WIN32)
add_executable(server_example_files
${server_example_SRCS}
)
target_link_libraries(server_example_files
iec61850
)

@ -1,7 +1,7 @@
LIBIEC_HOME=../..
PROJECT_BINARY_NAME = server_example3
PROJECT_SOURCES = server_example3.c
PROJECT_BINARY_NAME = server_example_files
PROJECT_SOURCES = server_example_files.c
PROJECT_SOURCES += static_model.c
PROJECT_ICD_FILE = simpleIO_direct_control.icd

@ -0,0 +1,98 @@
/*
* server_example_files.c
*
* - How to use some special MMS file service features
* - How to control how files file services can be used
*/
#include "iec61850_server.h"
#include "hal_thread.h"
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "static_model.h"
/* import IEC 61850 device model created from SCL-File */
extern IedModel iedModel;
static int running = 0;
static IedServer iedServer = NULL;
void
sigint_handler(int signalId)
{
running = 0;
}
static void
connectionHandler (IedServer self, ClientConnection connection, bool connected, void* parameter)
{
if (connected)
printf("Connection opened\n");
else
printf("Connection closed\n");
}
static MmsError
fileAccessHandler (void* parameter, MmsServerConnection connection, MmsFileServiceType service,
const char* localFilename, const char* otherFilename)
{
printf("fileAccessHandler: service = %i, local-file: %s other-file: %s\n", service, localFilename, otherFilename);
/* Don't allow client to rename files */
if (service == MMS_FILE_ACCESS_TYPE_RENAME)
return MMS_ERROR_FILE_FILE_ACCESS_DENIED;
/* Don't allow client to delete fike "IEDSERVER.BIN" */
if (service == MMS_FILE_ACCESS_TYPE_DELETE) {
if (strcmp(localFilename, "IEDSERVER.BIN") == 0)
return MMS_ERROR_FILE_FILE_ACCESS_DENIED;
}
/* allow all other accesses */
return MMS_ERROR_NONE;
}
int
main(int argc, char** argv)
{
printf("Using libIEC61850 version %s\n", LibIEC61850_getVersionString());
iedServer = IedServer_create(&iedModel);
/* Set the base path for the MMS file services */
MmsServer mmsServer = IedServer_getMmsServer(iedServer);
MmsServer_setFilestoreBasepath(mmsServer, "./vmd-filestore/");
/* Set a callback handler to control file accesses */
MmsServer_installFileAccessHandler(mmsServer, fileAccessHandler, NULL);
IedServer_setConnectionIndicationHandler(iedServer, (IedConnectionIndicationHandler) connectionHandler, NULL);
/* MMS server will be instructed to start listening to client connections. */
IedServer_start(iedServer, 102);
if (!IedServer_isRunning(iedServer)) {
printf("Starting server failed! Exit.\n");
IedServer_destroy(iedServer);
exit(-1);
}
running = 1;
signal(SIGINT, sigint_handler);
while (running)
Thread_sleep(100);
/* stop MMS server - close TCP server socket and all client sockets */
IedServer_stop(iedServer);
/* Cleanup - free all resources */
IedServer_destroy(iedServer);
} /* main() */

@ -0,0 +1,281 @@
<?xml version="1.0" encoding="UTF-8"?>
<SCL xmlns="http://www.iec.ch/61850/2003/SCL">
<Header id="" nameStructure="IEDName">
</Header>
<Communication>
<SubNetwork name="subnetwork1" type="8-MMS">
<Text>Station bus</Text>
<BitRate unit="b/s">10</BitRate>
<ConnectedAP iedName="simpleIO" apName="accessPoint1">
<Address>
<P type="IP">10.0.0.2</P>
<P type="IP-SUBNET">255.255.255.0</P>
<P type="IP-GATEWAY">10.0.0.1</P>
<P type="OSI-TSEL">0001</P>
<P type="OSI-PSEL">00000001</P>
<P type="OSI-SSEL">0001</P>
</Address>
</ConnectedAP>
</SubNetwork>
</Communication>
<IED name="simpleIO">
<Services>
<DynAssociation />
<GetDirectory />
<GetDataObjectDefinition />
<GetDataSetValue />
<DataSetDirectory />
<ReadWrite />
<GetCBValues />
<ConfLNs fixPrefix="true" fixLnInst="true" />
<GOOSE max="5" />
<GSSE max="5" />
<FileHandling />
<GSEDir />
<TimerActivatedControl />
</Services>
<AccessPoint name="accessPoint1">
<Server>
<Authentication />
<LDevice inst="GenericIO">
<LN0 lnClass="LLN0" lnType="LLN01" inst="">
<DataSet name="Events" desc="Events">
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO1" daName="stVal" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO2" daName="stVal" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO3" daName="stVal" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO4" daName="stVal" />
</DataSet>
<DataSet name="Events2" desc="Events2">
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO1" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO2" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO3" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="ST" lnInst="1" doName="SPCSO4" />
</DataSet>
<DataSet name="Measurements" desc="Measurements">
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="MX" lnInst="1" doName="AnIn1" daName="mag.f" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="MX" lnInst="1" doName="AnIn1" daName="q" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="MX" lnInst="1" doName="AnIn2" daName="mag.f" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="MX" lnInst="1" doName="AnIn2" daName="q" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="MX" lnInst="1" doName="AnIn3" daName="mag.f" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="MX" lnInst="1" doName="AnIn3" daName="q" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="MX" lnInst="1" doName="AnIn4" daName="mag.f" />
<FCDA ldInst="GenericIO" lnClass="GGIO" fc="MX" lnInst="1" doName="AnIn4" daName="q" />
</DataSet>
<ReportControl name="EventsRCB" confRev="4294967295" datSet="Events" rptID="Events1" buffered="false" intgPd="1000" bufTime="50">
<TrgOps period="true" />
<OptFields seqNum="true" timeStamp="true" dataSet="true" reasonCode="true" entryID="true" configRef="true" />
<RptEnabled max="1" />
</ReportControl>
<ReportControl name="EventsIndexed" indexed="true" confRev="1" datSet="Events" rptID="Events2" buffered="false" intgPd="1000" bufTime="50">
<TrgOps period="true" />
<OptFields seqNum="true" timeStamp="true" dataSet="true" reasonCode="true" entryID="true" configRef="true" />
<RptEnabled max="3" />
</ReportControl>
<ReportControl name="Measurements" indexed="true" confRev="1" datSet="Measurements" rptID="Measurements" buffered="true" intgPd="1000" bufTime="50">
<TrgOps period="false" />
<OptFields seqNum="true" timeStamp="true" dataSet="true" reasonCode="true" entryID="true" configRef="true" />
<RptEnabled max="3" />
</ReportControl>
<LogControl name="EventLog" datSet="Events" logName="EventLog">
<TrgOps dchg="true" qchg="true"/>
</LogControl>
<LogControl name="GeneralLog" logName="">
<TrgOps dchg="true" qchg="true"/>
</LogControl>
<Log />
<Log name="EventLog" />
<DOI name="Mod">
<DAI name="ctlModel">
<Val>status-only</Val>
</DAI>
</DOI>
<DOI name="NamPlt">
<DAI name="vendor">
<Val>MZ Automation</Val>
</DAI>
<DAI name="swRev">
<Val>0.7.3</Val>
</DAI>
<DAI name="d">
<Val>libiec61850 server example</Val>
</DAI>
</DOI>
</LN0>
<LN lnClass="LPHD" lnType="LPHD1" inst="1" prefix="" />
<LN lnClass="GGIO" lnType="GGIO1" inst="1" prefix="">
<DOI name="Mod">
<DAI name="ctlModel">
<Val>status-only</Val>
</DAI>
</DOI>
<DOI name="SPCSO1">
<DAI name="ctlModel">
<Val>direct-with-normal-security</Val>
</DAI>
</DOI>
<DOI name="SPCSO2">
<DAI name="ctlModel">
<Val>direct-with-normal-security</Val>
</DAI>
</DOI>
<DOI name="SPCSO3">
<DAI name="ctlModel">
<Val>direct-with-normal-security</Val>
</DAI>
</DOI>
<DOI name="SPCSO4">
<DAI name="ctlModel">
<Val>direct-with-normal-security</Val>
</DAI>
</DOI>
</LN>
</LDevice>
</Server>
</AccessPoint>
</IED>
<DataTypeTemplates>
<LNodeType id="LLN01" lnClass="LLN0">
<DO name="Mod" type="INC_1_Mod" />
<DO name="Beh" type="INS_1_Beh" />
<DO name="Health" type="INS_1_Beh" />
<DO name="NamPlt" type="LPL_1_NamPlt" />
</LNodeType>
<LNodeType id="LPHD1" lnClass="LPHD">
<DO name="PhyNam" type="DPL_1_PhyNam" />
<DO name="PhyHealth" type="INS_1_Beh" />
<DO name="Proxy" type="SPS_1_Proxy" />
</LNodeType>
<LNodeType id="GGIO1" lnClass="GGIO">
<DO name="Mod" type="INC_2_Mod" />
<DO name="Beh" type="INS_1_Beh" />
<DO name="Health" type="INS_1_Beh" />
<DO name="NamPlt" type="LPL_2_NamPlt" />
<DO name="AnIn1" type="MV_1_AnIn1" />
<DO name="AnIn2" type="MV_1_AnIn1" />
<DO name="AnIn3" type="MV_1_AnIn1" />
<DO name="AnIn4" type="MV_1_AnIn1" />
<DO name="SPCSO1" type="SPC_2_SPCSO1" />
<DO name="SPCSO2" type="SPC_1_SPCSO2" />
<DO name="SPCSO3" type="SPC_1_SPCSO3" />
<DO name="SPCSO4" type="SPC_1_SPCSO1" />
<DO name="Ind1" type="SPS_1_Proxy" />
<DO name="Ind2" type="SPS_1_Proxy" />
<DO name="Ind3" type="SPS_1_Proxy" />
<DO name="Ind4" type="SPS_1_Proxy" />
</LNodeType>
<DOType id="INC_1_Mod" cdc="INC">
<DA name="stVal" bType="INT32" fc="ST" dchg="true" />
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="t" bType="Timestamp" fc="ST" />
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
</DOType>
<DOType id="INS_1_Beh" cdc="INS">
<DA name="stVal" bType="INT32" fc="ST" dchg="true" />
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="t" bType="Timestamp" fc="ST" />
</DOType>
<DOType id="LPL_1_NamPlt" cdc="LPL">
<DA name="vendor" bType="VisString255" fc="DC" />
<DA name="swRev" bType="VisString255" fc="DC" />
<DA name="d" bType="VisString255" fc="DC" />
<DA name="configRev" bType="VisString255" fc="DC" />
<DA name="ldNs" bType="VisString255" fc="EX" />
</DOType>
<DOType id="DPL_1_PhyNam" cdc="DPL">
<DA name="vendor" bType="VisString255" fc="DC" />
</DOType>
<DOType id="SPS_1_Proxy" cdc="SPS">
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="t" bType="Timestamp" fc="ST" />
</DOType>
<DOType id="LPL_2_NamPlt" cdc="LPL">
<DA name="vendor" bType="VisString255" fc="DC" />
<DA name="swRev" bType="VisString255" fc="DC" />
<DA name="d" bType="VisString255" fc="DC" />
</DOType>
<DOType id="MV_1_AnIn1" cdc="MV">
<DA name="mag" type="AnalogueValue_1" bType="Struct" fc="MX" dchg="true" />
<DA name="q" bType="Quality" fc="MX" qchg="true" />
<DA name="t" bType="Timestamp" fc="MX" />
</DOType>
<DOType id="SPC_1_SPCSO1" cdc="SPC">
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="Oper" type="SPCOperate_1" bType="Struct" fc="CO" />
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
<DA name="t" bType="Timestamp" fc="ST" />
</DOType>
<DOType id="INC_2_Mod" cdc="INC">
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="t" bType="Timestamp" fc="ST" />
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
</DOType>
<DOType id="SPC_2_SPCSO1" cdc="SPC">
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="Oper" type="SPCOperate_1" bType="Struct" fc="CO" />
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
<DA name="t" bType="Timestamp" fc="ST" />
</DOType>
<DOType id="SPC_1_SPCSO2" cdc="SPC">
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="Oper" type="SPCOperate_1" bType="Struct" fc="CO" />
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
<DA name="t" bType="Timestamp" fc="ST" />
</DOType>
<DOType id="SPC_1_SPCSO3" cdc="SPC">
<DA name="stVal" bType="BOOLEAN" fc="ST" dchg="true" />
<DA name="q" bType="Quality" fc="ST" qchg="true" />
<DA name="Oper" type="SPCOperate_1" bType="Struct" fc="CO" />
<DA name="ctlModel" type="CtlModels" bType="Enum" fc="CF" />
<DA name="t" bType="Timestamp" fc="ST" />
</DOType>
<DAType id="AnalogueValue_1">
<BDA name="f" bType="FLOAT32" />
</DAType>
<DAType id="Originator_1">
<BDA name="orCat" type="OrCat" bType="Enum" />
<BDA name="orIdent" bType="Octet64" />
</DAType>
<DAType id="SPCOperate_1">
<BDA name="ctlVal" bType="BOOLEAN" />
<BDA name="origin" type="Originator_1" bType="Struct" />
<BDA name="ctlNum" bType="INT8U" />
<BDA name="T" bType="Timestamp" />
<BDA name="Test" bType="BOOLEAN" />
<BDA name="Check" bType="Check" />
</DAType>
<EnumType id="CtlModels">
<EnumVal ord="0">status-only</EnumVal>
<EnumVal ord="1">direct-with-normal-security</EnumVal>
<EnumVal ord="2">sbo-with-normal-security</EnumVal>
<EnumVal ord="3">direct-with-enhanced-security</EnumVal>
<EnumVal ord="4">sbo-with-enhanced-security</EnumVal>
</EnumType>
<EnumType id="OrCat">
<EnumVal ord="0">not-supported</EnumVal>
<EnumVal ord="1">bay-control</EnumVal>
<EnumVal ord="2">station-control</EnumVal>
<EnumVal ord="3">remote-control</EnumVal>
<EnumVal ord="4">automatic-bay</EnumVal>
<EnumVal ord="5">automatic-station</EnumVal>
<EnumVal ord="6">automatic-remote</EnumVal>
<EnumVal ord="7">maintenance</EnumVal>
<EnumVal ord="8">process</EnumVal>
</EnumType>
</DataTypeTemplates>
</SCL>

@ -0,0 +1,301 @@
/*
* static_model.h
*
* automatically generated from simpleIO_direct_control.icd
*/
#ifndef STATIC_MODEL_H_
#define STATIC_MODEL_H_
#include <stdlib.h>
#include "iec61850_model.h"
extern IedModel iedModel;
extern LogicalDevice iedModel_GenericIO;
extern LogicalNode iedModel_GenericIO_LLN0;
extern DataObject iedModel_GenericIO_LLN0_Mod;
extern DataAttribute iedModel_GenericIO_LLN0_Mod_stVal;
extern DataAttribute iedModel_GenericIO_LLN0_Mod_q;
extern DataAttribute iedModel_GenericIO_LLN0_Mod_t;
extern DataAttribute iedModel_GenericIO_LLN0_Mod_ctlModel;
extern DataObject iedModel_GenericIO_LLN0_Beh;
extern DataAttribute iedModel_GenericIO_LLN0_Beh_stVal;
extern DataAttribute iedModel_GenericIO_LLN0_Beh_q;
extern DataAttribute iedModel_GenericIO_LLN0_Beh_t;
extern DataObject iedModel_GenericIO_LLN0_Health;
extern DataAttribute iedModel_GenericIO_LLN0_Health_stVal;
extern DataAttribute iedModel_GenericIO_LLN0_Health_q;
extern DataAttribute iedModel_GenericIO_LLN0_Health_t;
extern DataObject iedModel_GenericIO_LLN0_NamPlt;
extern DataAttribute iedModel_GenericIO_LLN0_NamPlt_vendor;
extern DataAttribute iedModel_GenericIO_LLN0_NamPlt_swRev;
extern DataAttribute iedModel_GenericIO_LLN0_NamPlt_d;
extern DataAttribute iedModel_GenericIO_LLN0_NamPlt_configRev;
extern DataAttribute iedModel_GenericIO_LLN0_NamPlt_ldNs;
extern LogicalNode iedModel_GenericIO_LPHD1;
extern DataObject iedModel_GenericIO_LPHD1_PhyNam;
extern DataAttribute iedModel_GenericIO_LPHD1_PhyNam_vendor;
extern DataObject iedModel_GenericIO_LPHD1_PhyHealth;
extern DataAttribute iedModel_GenericIO_LPHD1_PhyHealth_stVal;
extern DataAttribute iedModel_GenericIO_LPHD1_PhyHealth_q;
extern DataAttribute iedModel_GenericIO_LPHD1_PhyHealth_t;
extern DataObject iedModel_GenericIO_LPHD1_Proxy;
extern DataAttribute iedModel_GenericIO_LPHD1_Proxy_stVal;
extern DataAttribute iedModel_GenericIO_LPHD1_Proxy_q;
extern DataAttribute iedModel_GenericIO_LPHD1_Proxy_t;
extern LogicalNode iedModel_GenericIO_GGIO1;
extern DataObject iedModel_GenericIO_GGIO1_Mod;
extern DataAttribute iedModel_GenericIO_GGIO1_Mod_q;
extern DataAttribute iedModel_GenericIO_GGIO1_Mod_t;
extern DataAttribute iedModel_GenericIO_GGIO1_Mod_ctlModel;
extern DataObject iedModel_GenericIO_GGIO1_Beh;
extern DataAttribute iedModel_GenericIO_GGIO1_Beh_stVal;
extern DataAttribute iedModel_GenericIO_GGIO1_Beh_q;
extern DataAttribute iedModel_GenericIO_GGIO1_Beh_t;
extern DataObject iedModel_GenericIO_GGIO1_Health;
extern DataAttribute iedModel_GenericIO_GGIO1_Health_stVal;
extern DataAttribute iedModel_GenericIO_GGIO1_Health_q;
extern DataAttribute iedModel_GenericIO_GGIO1_Health_t;
extern DataObject iedModel_GenericIO_GGIO1_NamPlt;
extern DataAttribute iedModel_GenericIO_GGIO1_NamPlt_vendor;
extern DataAttribute iedModel_GenericIO_GGIO1_NamPlt_swRev;
extern DataAttribute iedModel_GenericIO_GGIO1_NamPlt_d;
extern DataObject iedModel_GenericIO_GGIO1_AnIn1;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn1_mag;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn1_mag_f;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn1_q;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn1_t;
extern DataObject iedModel_GenericIO_GGIO1_AnIn2;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn2_mag;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn2_mag_f;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn2_q;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn2_t;
extern DataObject iedModel_GenericIO_GGIO1_AnIn3;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn3_mag;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn3_mag_f;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn3_q;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn3_t;
extern DataObject iedModel_GenericIO_GGIO1_AnIn4;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn4_mag;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn4_mag_f;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn4_q;
extern DataAttribute iedModel_GenericIO_GGIO1_AnIn4_t;
extern DataObject iedModel_GenericIO_GGIO1_SPCSO1;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_stVal;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_q;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_Oper;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_Oper_ctlVal;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_Oper_origin;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_Oper_origin_orCat;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_Oper_origin_orIdent;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_Oper_ctlNum;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_Oper_T;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_Oper_Test;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_Oper_Check;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_ctlModel;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO1_t;
extern DataObject iedModel_GenericIO_GGIO1_SPCSO2;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_stVal;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_q;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_Oper;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_Oper_ctlVal;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_Oper_origin;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_Oper_origin_orCat;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_Oper_origin_orIdent;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_Oper_ctlNum;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_Oper_T;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_Oper_Test;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_Oper_Check;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_ctlModel;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO2_t;
extern DataObject iedModel_GenericIO_GGIO1_SPCSO3;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_stVal;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_q;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_Oper;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_Oper_ctlVal;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_Oper_origin;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_Oper_origin_orCat;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_Oper_origin_orIdent;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_Oper_ctlNum;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_Oper_T;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_Oper_Test;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_Oper_Check;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_ctlModel;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO3_t;
extern DataObject iedModel_GenericIO_GGIO1_SPCSO4;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_stVal;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_q;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_Oper;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_Oper_ctlVal;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_Oper_origin;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_Oper_origin_orCat;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_Oper_origin_orIdent;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_Oper_ctlNum;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_Oper_T;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_Oper_Test;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_Oper_Check;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_ctlModel;
extern DataAttribute iedModel_GenericIO_GGIO1_SPCSO4_t;
extern DataObject iedModel_GenericIO_GGIO1_Ind1;
extern DataAttribute iedModel_GenericIO_GGIO1_Ind1_stVal;
extern DataAttribute iedModel_GenericIO_GGIO1_Ind1_q;
extern DataAttribute iedModel_GenericIO_GGIO1_Ind1_t;
extern DataObject iedModel_GenericIO_GGIO1_Ind2;
extern DataAttribute iedModel_GenericIO_GGIO1_Ind2_stVal;
extern DataAttribute iedModel_GenericIO_GGIO1_Ind2_q;
extern DataAttribute iedModel_GenericIO_GGIO1_Ind2_t;
extern DataObject iedModel_GenericIO_GGIO1_Ind3;
extern DataAttribute iedModel_GenericIO_GGIO1_Ind3_stVal;
extern DataAttribute iedModel_GenericIO_GGIO1_Ind3_q;
extern DataAttribute iedModel_GenericIO_GGIO1_Ind3_t;
extern DataObject iedModel_GenericIO_GGIO1_Ind4;
extern DataAttribute iedModel_GenericIO_GGIO1_Ind4_stVal;
extern DataAttribute iedModel_GenericIO_GGIO1_Ind4_q;
extern DataAttribute iedModel_GenericIO_GGIO1_Ind4_t;
#define IEDMODEL_GenericIO (&iedModel_GenericIO)
#define IEDMODEL_GenericIO_LLN0 (&iedModel_GenericIO_LLN0)
#define IEDMODEL_GenericIO_LLN0_Mod (&iedModel_GenericIO_LLN0_Mod)
#define IEDMODEL_GenericIO_LLN0_Mod_stVal (&iedModel_GenericIO_LLN0_Mod_stVal)
#define IEDMODEL_GenericIO_LLN0_Mod_q (&iedModel_GenericIO_LLN0_Mod_q)
#define IEDMODEL_GenericIO_LLN0_Mod_t (&iedModel_GenericIO_LLN0_Mod_t)
#define IEDMODEL_GenericIO_LLN0_Mod_ctlModel (&iedModel_GenericIO_LLN0_Mod_ctlModel)
#define IEDMODEL_GenericIO_LLN0_Beh (&iedModel_GenericIO_LLN0_Beh)
#define IEDMODEL_GenericIO_LLN0_Beh_stVal (&iedModel_GenericIO_LLN0_Beh_stVal)
#define IEDMODEL_GenericIO_LLN0_Beh_q (&iedModel_GenericIO_LLN0_Beh_q)
#define IEDMODEL_GenericIO_LLN0_Beh_t (&iedModel_GenericIO_LLN0_Beh_t)
#define IEDMODEL_GenericIO_LLN0_Health (&iedModel_GenericIO_LLN0_Health)
#define IEDMODEL_GenericIO_LLN0_Health_stVal (&iedModel_GenericIO_LLN0_Health_stVal)
#define IEDMODEL_GenericIO_LLN0_Health_q (&iedModel_GenericIO_LLN0_Health_q)
#define IEDMODEL_GenericIO_LLN0_Health_t (&iedModel_GenericIO_LLN0_Health_t)
#define IEDMODEL_GenericIO_LLN0_NamPlt (&iedModel_GenericIO_LLN0_NamPlt)
#define IEDMODEL_GenericIO_LLN0_NamPlt_vendor (&iedModel_GenericIO_LLN0_NamPlt_vendor)
#define IEDMODEL_GenericIO_LLN0_NamPlt_swRev (&iedModel_GenericIO_LLN0_NamPlt_swRev)
#define IEDMODEL_GenericIO_LLN0_NamPlt_d (&iedModel_GenericIO_LLN0_NamPlt_d)
#define IEDMODEL_GenericIO_LLN0_NamPlt_configRev (&iedModel_GenericIO_LLN0_NamPlt_configRev)
#define IEDMODEL_GenericIO_LLN0_NamPlt_ldNs (&iedModel_GenericIO_LLN0_NamPlt_ldNs)
#define IEDMODEL_GenericIO_LPHD1 (&iedModel_GenericIO_LPHD1)
#define IEDMODEL_GenericIO_LPHD1_PhyNam (&iedModel_GenericIO_LPHD1_PhyNam)
#define IEDMODEL_GenericIO_LPHD1_PhyNam_vendor (&iedModel_GenericIO_LPHD1_PhyNam_vendor)
#define IEDMODEL_GenericIO_LPHD1_PhyHealth (&iedModel_GenericIO_LPHD1_PhyHealth)
#define IEDMODEL_GenericIO_LPHD1_PhyHealth_stVal (&iedModel_GenericIO_LPHD1_PhyHealth_stVal)
#define IEDMODEL_GenericIO_LPHD1_PhyHealth_q (&iedModel_GenericIO_LPHD1_PhyHealth_q)
#define IEDMODEL_GenericIO_LPHD1_PhyHealth_t (&iedModel_GenericIO_LPHD1_PhyHealth_t)
#define IEDMODEL_GenericIO_LPHD1_Proxy (&iedModel_GenericIO_LPHD1_Proxy)
#define IEDMODEL_GenericIO_LPHD1_Proxy_stVal (&iedModel_GenericIO_LPHD1_Proxy_stVal)
#define IEDMODEL_GenericIO_LPHD1_Proxy_q (&iedModel_GenericIO_LPHD1_Proxy_q)
#define IEDMODEL_GenericIO_LPHD1_Proxy_t (&iedModel_GenericIO_LPHD1_Proxy_t)
#define IEDMODEL_GenericIO_GGIO1 (&iedModel_GenericIO_GGIO1)
#define IEDMODEL_GenericIO_GGIO1_Mod (&iedModel_GenericIO_GGIO1_Mod)
#define IEDMODEL_GenericIO_GGIO1_Mod_q (&iedModel_GenericIO_GGIO1_Mod_q)
#define IEDMODEL_GenericIO_GGIO1_Mod_t (&iedModel_GenericIO_GGIO1_Mod_t)
#define IEDMODEL_GenericIO_GGIO1_Mod_ctlModel (&iedModel_GenericIO_GGIO1_Mod_ctlModel)
#define IEDMODEL_GenericIO_GGIO1_Beh (&iedModel_GenericIO_GGIO1_Beh)
#define IEDMODEL_GenericIO_GGIO1_Beh_stVal (&iedModel_GenericIO_GGIO1_Beh_stVal)
#define IEDMODEL_GenericIO_GGIO1_Beh_q (&iedModel_GenericIO_GGIO1_Beh_q)
#define IEDMODEL_GenericIO_GGIO1_Beh_t (&iedModel_GenericIO_GGIO1_Beh_t)
#define IEDMODEL_GenericIO_GGIO1_Health (&iedModel_GenericIO_GGIO1_Health)
#define IEDMODEL_GenericIO_GGIO1_Health_stVal (&iedModel_GenericIO_GGIO1_Health_stVal)
#define IEDMODEL_GenericIO_GGIO1_Health_q (&iedModel_GenericIO_GGIO1_Health_q)
#define IEDMODEL_GenericIO_GGIO1_Health_t (&iedModel_GenericIO_GGIO1_Health_t)
#define IEDMODEL_GenericIO_GGIO1_NamPlt (&iedModel_GenericIO_GGIO1_NamPlt)
#define IEDMODEL_GenericIO_GGIO1_NamPlt_vendor (&iedModel_GenericIO_GGIO1_NamPlt_vendor)
#define IEDMODEL_GenericIO_GGIO1_NamPlt_swRev (&iedModel_GenericIO_GGIO1_NamPlt_swRev)
#define IEDMODEL_GenericIO_GGIO1_NamPlt_d (&iedModel_GenericIO_GGIO1_NamPlt_d)
#define IEDMODEL_GenericIO_GGIO1_AnIn1 (&iedModel_GenericIO_GGIO1_AnIn1)
#define IEDMODEL_GenericIO_GGIO1_AnIn1_mag (&iedModel_GenericIO_GGIO1_AnIn1_mag)
#define IEDMODEL_GenericIO_GGIO1_AnIn1_mag_f (&iedModel_GenericIO_GGIO1_AnIn1_mag_f)
#define IEDMODEL_GenericIO_GGIO1_AnIn1_q (&iedModel_GenericIO_GGIO1_AnIn1_q)
#define IEDMODEL_GenericIO_GGIO1_AnIn1_t (&iedModel_GenericIO_GGIO1_AnIn1_t)
#define IEDMODEL_GenericIO_GGIO1_AnIn2 (&iedModel_GenericIO_GGIO1_AnIn2)
#define IEDMODEL_GenericIO_GGIO1_AnIn2_mag (&iedModel_GenericIO_GGIO1_AnIn2_mag)
#define IEDMODEL_GenericIO_GGIO1_AnIn2_mag_f (&iedModel_GenericIO_GGIO1_AnIn2_mag_f)
#define IEDMODEL_GenericIO_GGIO1_AnIn2_q (&iedModel_GenericIO_GGIO1_AnIn2_q)
#define IEDMODEL_GenericIO_GGIO1_AnIn2_t (&iedModel_GenericIO_GGIO1_AnIn2_t)
#define IEDMODEL_GenericIO_GGIO1_AnIn3 (&iedModel_GenericIO_GGIO1_AnIn3)
#define IEDMODEL_GenericIO_GGIO1_AnIn3_mag (&iedModel_GenericIO_GGIO1_AnIn3_mag)
#define IEDMODEL_GenericIO_GGIO1_AnIn3_mag_f (&iedModel_GenericIO_GGIO1_AnIn3_mag_f)
#define IEDMODEL_GenericIO_GGIO1_AnIn3_q (&iedModel_GenericIO_GGIO1_AnIn3_q)
#define IEDMODEL_GenericIO_GGIO1_AnIn3_t (&iedModel_GenericIO_GGIO1_AnIn3_t)
#define IEDMODEL_GenericIO_GGIO1_AnIn4 (&iedModel_GenericIO_GGIO1_AnIn4)
#define IEDMODEL_GenericIO_GGIO1_AnIn4_mag (&iedModel_GenericIO_GGIO1_AnIn4_mag)
#define IEDMODEL_GenericIO_GGIO1_AnIn4_mag_f (&iedModel_GenericIO_GGIO1_AnIn4_mag_f)
#define IEDMODEL_GenericIO_GGIO1_AnIn4_q (&iedModel_GenericIO_GGIO1_AnIn4_q)
#define IEDMODEL_GenericIO_GGIO1_AnIn4_t (&iedModel_GenericIO_GGIO1_AnIn4_t)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1 (&iedModel_GenericIO_GGIO1_SPCSO1)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_stVal (&iedModel_GenericIO_GGIO1_SPCSO1_stVal)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_q (&iedModel_GenericIO_GGIO1_SPCSO1_q)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_Oper (&iedModel_GenericIO_GGIO1_SPCSO1_Oper)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_Oper_ctlVal (&iedModel_GenericIO_GGIO1_SPCSO1_Oper_ctlVal)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_Oper_origin (&iedModel_GenericIO_GGIO1_SPCSO1_Oper_origin)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_Oper_origin_orCat (&iedModel_GenericIO_GGIO1_SPCSO1_Oper_origin_orCat)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_Oper_origin_orIdent (&iedModel_GenericIO_GGIO1_SPCSO1_Oper_origin_orIdent)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_Oper_ctlNum (&iedModel_GenericIO_GGIO1_SPCSO1_Oper_ctlNum)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_Oper_T (&iedModel_GenericIO_GGIO1_SPCSO1_Oper_T)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_Oper_Test (&iedModel_GenericIO_GGIO1_SPCSO1_Oper_Test)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_Oper_Check (&iedModel_GenericIO_GGIO1_SPCSO1_Oper_Check)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_ctlModel (&iedModel_GenericIO_GGIO1_SPCSO1_ctlModel)
#define IEDMODEL_GenericIO_GGIO1_SPCSO1_t (&iedModel_GenericIO_GGIO1_SPCSO1_t)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2 (&iedModel_GenericIO_GGIO1_SPCSO2)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_stVal (&iedModel_GenericIO_GGIO1_SPCSO2_stVal)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_q (&iedModel_GenericIO_GGIO1_SPCSO2_q)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_Oper (&iedModel_GenericIO_GGIO1_SPCSO2_Oper)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_Oper_ctlVal (&iedModel_GenericIO_GGIO1_SPCSO2_Oper_ctlVal)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_Oper_origin (&iedModel_GenericIO_GGIO1_SPCSO2_Oper_origin)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_Oper_origin_orCat (&iedModel_GenericIO_GGIO1_SPCSO2_Oper_origin_orCat)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_Oper_origin_orIdent (&iedModel_GenericIO_GGIO1_SPCSO2_Oper_origin_orIdent)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_Oper_ctlNum (&iedModel_GenericIO_GGIO1_SPCSO2_Oper_ctlNum)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_Oper_T (&iedModel_GenericIO_GGIO1_SPCSO2_Oper_T)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_Oper_Test (&iedModel_GenericIO_GGIO1_SPCSO2_Oper_Test)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_Oper_Check (&iedModel_GenericIO_GGIO1_SPCSO2_Oper_Check)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_ctlModel (&iedModel_GenericIO_GGIO1_SPCSO2_ctlModel)
#define IEDMODEL_GenericIO_GGIO1_SPCSO2_t (&iedModel_GenericIO_GGIO1_SPCSO2_t)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3 (&iedModel_GenericIO_GGIO1_SPCSO3)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_stVal (&iedModel_GenericIO_GGIO1_SPCSO3_stVal)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_q (&iedModel_GenericIO_GGIO1_SPCSO3_q)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_Oper (&iedModel_GenericIO_GGIO1_SPCSO3_Oper)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_Oper_ctlVal (&iedModel_GenericIO_GGIO1_SPCSO3_Oper_ctlVal)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_Oper_origin (&iedModel_GenericIO_GGIO1_SPCSO3_Oper_origin)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_Oper_origin_orCat (&iedModel_GenericIO_GGIO1_SPCSO3_Oper_origin_orCat)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_Oper_origin_orIdent (&iedModel_GenericIO_GGIO1_SPCSO3_Oper_origin_orIdent)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_Oper_ctlNum (&iedModel_GenericIO_GGIO1_SPCSO3_Oper_ctlNum)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_Oper_T (&iedModel_GenericIO_GGIO1_SPCSO3_Oper_T)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_Oper_Test (&iedModel_GenericIO_GGIO1_SPCSO3_Oper_Test)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_Oper_Check (&iedModel_GenericIO_GGIO1_SPCSO3_Oper_Check)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_ctlModel (&iedModel_GenericIO_GGIO1_SPCSO3_ctlModel)
#define IEDMODEL_GenericIO_GGIO1_SPCSO3_t (&iedModel_GenericIO_GGIO1_SPCSO3_t)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4 (&iedModel_GenericIO_GGIO1_SPCSO4)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_stVal (&iedModel_GenericIO_GGIO1_SPCSO4_stVal)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_q (&iedModel_GenericIO_GGIO1_SPCSO4_q)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_Oper (&iedModel_GenericIO_GGIO1_SPCSO4_Oper)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_Oper_ctlVal (&iedModel_GenericIO_GGIO1_SPCSO4_Oper_ctlVal)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_Oper_origin (&iedModel_GenericIO_GGIO1_SPCSO4_Oper_origin)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_Oper_origin_orCat (&iedModel_GenericIO_GGIO1_SPCSO4_Oper_origin_orCat)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_Oper_origin_orIdent (&iedModel_GenericIO_GGIO1_SPCSO4_Oper_origin_orIdent)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_Oper_ctlNum (&iedModel_GenericIO_GGIO1_SPCSO4_Oper_ctlNum)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_Oper_T (&iedModel_GenericIO_GGIO1_SPCSO4_Oper_T)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_Oper_Test (&iedModel_GenericIO_GGIO1_SPCSO4_Oper_Test)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_Oper_Check (&iedModel_GenericIO_GGIO1_SPCSO4_Oper_Check)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_ctlModel (&iedModel_GenericIO_GGIO1_SPCSO4_ctlModel)
#define IEDMODEL_GenericIO_GGIO1_SPCSO4_t (&iedModel_GenericIO_GGIO1_SPCSO4_t)
#define IEDMODEL_GenericIO_GGIO1_Ind1 (&iedModel_GenericIO_GGIO1_Ind1)
#define IEDMODEL_GenericIO_GGIO1_Ind1_stVal (&iedModel_GenericIO_GGIO1_Ind1_stVal)
#define IEDMODEL_GenericIO_GGIO1_Ind1_q (&iedModel_GenericIO_GGIO1_Ind1_q)
#define IEDMODEL_GenericIO_GGIO1_Ind1_t (&iedModel_GenericIO_GGIO1_Ind1_t)
#define IEDMODEL_GenericIO_GGIO1_Ind2 (&iedModel_GenericIO_GGIO1_Ind2)
#define IEDMODEL_GenericIO_GGIO1_Ind2_stVal (&iedModel_GenericIO_GGIO1_Ind2_stVal)
#define IEDMODEL_GenericIO_GGIO1_Ind2_q (&iedModel_GenericIO_GGIO1_Ind2_q)
#define IEDMODEL_GenericIO_GGIO1_Ind2_t (&iedModel_GenericIO_GGIO1_Ind2_t)
#define IEDMODEL_GenericIO_GGIO1_Ind3 (&iedModel_GenericIO_GGIO1_Ind3)
#define IEDMODEL_GenericIO_GGIO1_Ind3_stVal (&iedModel_GenericIO_GGIO1_Ind3_stVal)
#define IEDMODEL_GenericIO_GGIO1_Ind3_q (&iedModel_GenericIO_GGIO1_Ind3_q)
#define IEDMODEL_GenericIO_GGIO1_Ind3_t (&iedModel_GenericIO_GGIO1_Ind3_t)
#define IEDMODEL_GenericIO_GGIO1_Ind4 (&iedModel_GenericIO_GGIO1_Ind4)
#define IEDMODEL_GenericIO_GGIO1_Ind4_stVal (&iedModel_GenericIO_GGIO1_Ind4_stVal)
#define IEDMODEL_GenericIO_GGIO1_Ind4_q (&iedModel_GenericIO_GGIO1_Ind4_q)
#define IEDMODEL_GenericIO_GGIO1_Ind4_t (&iedModel_GenericIO_GGIO1_Ind4_t)
#endif /* STATIC_MODEL_H_ */

@ -0,0 +1,21 @@
include_directories(
.
)
set(server_example_SRCS
server_example_password_auth.c
static_model.c
)
IF(WIN32)
set_source_files_properties(${server_example_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(WIN32)
add_executable(server_example_password_auth
${server_example_SRCS}
)
target_link_libraries(server_example_password_auth
iec61850
)

@ -1,7 +1,7 @@
LIBIEC_HOME=../..
PROJECT_BINARY_NAME = server_example4
PROJECT_SOURCES = server_example4.c
PROJECT_BINARY_NAME = server_example_password_auth
PROJECT_SOURCES = server_example_password_auth.c
PROJECT_SOURCES += static_model.c
PROJECT_ICD_FILE = simpleIO_direct_control.icd

@ -1,5 +1,5 @@
/*
* server_example4.c
* server_example_password_auth.c
*
* Example server application with password authentication.
*
@ -15,11 +15,11 @@
*/
#include "iec61850_server.h"
#include "static_model.h"
#include "hal_thread.h"
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include "../server_example_password_auth/static_model.h"
/* import IEC 61850 device model created from SCL-File */
extern IedModel iedModel;
@ -37,13 +37,32 @@ void sigint_handler(int signalId)
static char* password1 = "user1@testpw";
static char* password2 = "user2@testpw";
static void printAppTitle(ItuObjectIdentifier* oid)
{
int i;
for (i = 0; i < oid->arcCount; i++) {
printf("%i", oid->arc[i]);
if (i != (oid->arcCount - 1))
printf(".");
}
}
/**
* This is the AcseAuthenticator callback function that is invoked on each client connection attempt.
* When returning true the server stack accepts the client. Otherwise the connection is rejected.
*
* The security token can be used to pass an application specific object to other library callbacks
*/
static bool
clientAuthenticator(void* parameter, AcseAuthenticationParameter authParameter, void** securityToken)
clientAuthenticator(void* parameter, AcseAuthenticationParameter authParameter, void** securityToken, IsoApplicationReference* appRef)
{
printf("ACSE Authenticator:\n");
printf(" client ap-title: "); printAppTitle(&(appRef->apTitle)); printf("\n");
printf(" client ae-qualifier: %i\n", appRef->aeQualifier);
if (authParameter->mechanism == ACSE_AUTH_PASSWORD) {
if (authParameter->value.password.passwordLength == strlen(password1)) {
if (memcmp(authParameter->value.password.octetString, password1,

@ -3,7 +3,7 @@
*
* automatically generated from simpleIO_direct_control.icd
*/
#include "static_model.h"
#include "../server_example_password_auth/static_model.h"
static void initializeValues();

@ -0,0 +1,21 @@
include_directories(
.
)
set(server_example_SRCS
server_example_simple.c
static_model.c
)
IF(WIN32)
set_source_files_properties(${server_example_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(WIN32)
add_executable(server_example_simple
${server_example_SRCS}
)
target_link_libraries(server_example_simple
iec61850
)

@ -1,7 +1,7 @@
LIBIEC_HOME=../..
PROJECT_BINARY_NAME = server_example1
PROJECT_SOURCES = server_example1.c
PROJECT_BINARY_NAME = server_example_simple
PROJECT_SOURCES = server_example_simple.c
PROJECT_SOURCES += static_model.c
PROJECT_ICD_FILE = sampleModel_with_dataset.icd

@ -1,5 +1,5 @@
/*
* server_example1.c
* server_example_simple.c
*
* Copyright 2013 Michael Zillgith
*
@ -27,7 +27,7 @@
#include <stdlib.h>
#include <stdio.h>
#include "static_model.h"
#include "../server_example_simple/static_model.h"
/* import IEC 61850 device model created from SCL-File */
extern IedModel iedModel;

@ -3,7 +3,7 @@
*
* automatically generated from sampleModel_with_dataset.icd
*/
#include "static_model.h"
#include "../server_example_simple/static_model.h"
static void initializeValues();

@ -0,0 +1,21 @@
include_directories(
.
)
set(server_example_SRCS
server_example_write_handler.c
static_model.c
)
IF(WIN32)
set_source_files_properties(${server_example_SRCS}
PROPERTIES LANGUAGE CXX)
ENDIF(WIN32)
add_executable(server_example_write_handler
${server_example_SRCS}
)
target_link_libraries(server_example_write_handler
iec61850
)

@ -1,7 +1,7 @@
LIBIEC_HOME=../..
PROJECT_BINARY_NAME = server_example5
PROJECT_SOURCES = server_example5.c
PROJECT_BINARY_NAME = server_example_write_handler
PROJECT_SOURCES = server_example_write_handler.c
PROJECT_SOURCES += static_model.c
PROJECT_ICD_FILE = complexModel.icd

@ -1,5 +1,5 @@
/*
* server_example5.c
* server_example_write_handler.c
*/
#include "iec61850_server.h"
@ -8,7 +8,7 @@
#include <stdlib.h>
#include <stdio.h>
#include "static_model.h"
#include "../server_example_write_handler/static_model.h"
/* import IEC 61850 device model created from SCL-File */
extern IedModel iedModel;

@ -3,7 +3,7 @@
*
* automatically generated from complexModel.icd
*/
#include "static_model.h"
#include "../server_example_write_handler/static_model.h"
static void initializeValues();

@ -20,7 +20,16 @@ void sigint_handler(int signalId)
int
main(int argc, char** argv)
{
SampledValuesPublisher svPublisher = SampledValuesPublisher_create("vboxnet0");
char* interface;
if (argc > 1)
interface = argv[1];
else
interface = "eth0";
printf("Using interface %s\n", interface);
SampledValuesPublisher svPublisher = SampledValuesPublisher_create(NULL, interface);
SV_ASDU asdu1 = SampledValuesPublisher_addASDU(svPublisher, "svpub1", NULL, 1);
@ -51,7 +60,7 @@ main(int argc, char** argv)
SampledValuesPublisher_publish(svPublisher);
//Thread_sleep(50);
Thread_sleep(50);
}
SampledValuesPublisher_destroy(svPublisher);

@ -1,23 +1,40 @@
FIND_PACKAGE(SWIG REQUIRED)
INCLUDE(${SWIG_USE_FILE})
FIND_PACKAGE(PythonLibs REQUIRED)
FIND_PACKAGE ( PythonInterp ${PYTHONLIBS_VERSION_STRING} EXACT REQUIRED )
INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_SWIG_FLAGS "")
SET_PROPERTY(SOURCE iec61850.i PROPERTY CPLUSPLUS ON)
SWIG_ADD_MODULE(iec61850 python iec61850.i)
IF(WIN32)
SWIG_LINK_LIBRARIES(iec61850 ${PYTHON_LIBRARIES} iec61850 ws2_32)
ELSE()
SWIG_LINK_LIBRARIES(iec61850 ${PYTHON_LIBRARIES} iec61850-shared)
ENDIF(WIN32)
EXECUTE_PROCESS ( #Finding python modules install path
COMMAND ${PYTHON_EXECUTABLE} -c
"import site, sys; sys.stdout.write(site.getsitepackages()[-1])"
OUTPUT_VARIABLE PYTHON_SITE_DIR
)
INSTALL ( FILES ${CMAKE_CURRENT_BINARY_DIR}/iec61850.py DESTINATION ${PYTHON_SITE_DIR})
INSTALL ( TARGETS _iec61850 LIBRARY DESTINATION ${PYTHON_SITE_DIR})
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
find_package(PythonLibs REQUIRED)
find_package(PythonInterp ${PYTHONLIBS_VERSION_STRING} EXACT REQUIRED)
include_directories(${PYTHON_INCLUDE_PATH})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_SWIG_FLAGS "")
set_property(SOURCE iec61850.i PROPERTY CPLUSPLUS ON)
if(WIN32)
set(LIBS iec61850 ws2_32)
else()
set(LIBS iec61850-shared)
endif()
if(${SWIG_VERSION} VERSION_LESS 3.0)
swig_add_module(iec61850 python iec61850.i)
else()
swig_add_library(iec61850
LANGUAGE python
SOURCES iec61850.i
)
endif()
swig_link_libraries(iec61850 ${PYTHON_LIBRARIES} ${LIBS})
# Finding python modules install path
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c
"import site, sys; sys.stdout.write(site.getsitepackages()[-1])"
OUTPUT_VARIABLE PYTHON_SITE_DIR
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/iec61850.py DESTINATION ${PYTHON_SITE_DIR})
install(TARGETS _iec61850 LIBRARY DESTINATION ${PYTHON_SITE_DIR})
add_test(test_pyiec61850 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/test_pyiec61850.py)

@ -15,7 +15,7 @@
#include "platform_endian.h"
#define LIBIEC61850_VERSION "1.0.2"
#define LIBIEC61850_VERSION "1.1.1"
#ifndef CONFIG_DEFAULT_MMS_VENDOR_NAME
#define CONFIG_DEFAULT_MMS_VENDOR_NAME "libiec61850.com"

@ -18,7 +18,7 @@ DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "libIEC61850"
PROJECT_NUMBER = 1.0.2
PROJECT_NUMBER = 1.1.1
PROJECT_BRIEF = "Open-source IEC 61850 MMS/GOOSE/SV server and client library"

@ -31,6 +31,9 @@
extern "C" {
#endif
#ifndef GOOSE_SV_COMM_PARAMETERS
#define GOOSE_SV_COMM_PARAMETERS
typedef struct sCommParameters {
uint8_t vlanPriority;
uint16_t vlanId;
@ -38,6 +41,8 @@ typedef struct sCommParameters {
uint8_t dstAddress[6];
} CommParameters;
#endif
typedef struct sGoosePublisher* GoosePublisher;
GoosePublisher

@ -1,7 +1,7 @@
/*
* goose_receiver.c
*
* Copyright 2014, 2015 Michael Zillgith
* Copyright 2014-2017 Michael Zillgith
*
* This file is part of libIEC61850.
*
@ -52,6 +52,9 @@ struct sGooseReceiver {
uint8_t* buffer;
EthernetSocket ethSocket;
LinkedList subscriberList;
#if (CONFIG_MMS_THREADLESS_STACK == 0)
Thread thread;
#endif
};
@ -66,6 +69,9 @@ GooseReceiver_create()
self->buffer = (uint8_t*) GLOBAL_MALLOC(ETH_BUFFER_LENGTH);
self->ethSocket = NULL;
self->subscriberList = LinkedList_create();
#if (CONFIG_MMS_THREADLESS_STACK == 0)
self->thread = NULL;
#endif
}
return self;
@ -712,33 +718,52 @@ gooseReceiverLoop(void* threadParameter)
void
GooseReceiver_start(GooseReceiver self)
{
Thread thread = Thread_create((ThreadExecutionFunction) gooseReceiverLoop, (void*) self, true);
#if (CONFIG_MMS_THREADLESS_STACK == 0)
self->thread = Thread_create((ThreadExecutionFunction) gooseReceiverLoop, (void*) self, false);
if (thread != NULL) {
if (self->thread != NULL) {
if (DEBUG_GOOSE_SUBSCRIBER)
printf("GOOSE_SUBSCRIBER: GOOSE receiver started for interface %s\n", self->interfaceId);
Thread_start(thread);
Thread_start(self->thread);
}
else {
if (DEBUG_GOOSE_SUBSCRIBER)
printf("GOOSE_SUBSCRIBER: Starting GOOSE receiver failed for interface %s\n", self->interfaceId);
}
#endif
}
bool
GooseReceiver_isRunning(GooseReceiver self)
{
return self->running;
}
void
GooseReceiver_stop(GooseReceiver self)
{
#if (CONFIG_MMS_THREADLESS_STACK == 0)
self->running = false;
Thread_destroy(self->thread);
while (self->stopped == false)
Thread_sleep(1);
#endif
}
void
GooseReceiver_destroy(GooseReceiver self)
{
#if (CONFIG_MMS_THREADLESS_STACK == 0)
if ((self->thread != NULL) && (GooseReceiver_isRunning(self)))
GooseReceiver_stop(self);
#endif
if (self->interfaceId != NULL)
GLOBAL_FREEMEM(self->interfaceId);
LinkedList_destroyDeep(self->subscriberList,
(LinkedListValueDeleteFunction) GooseSubscriber_destroy);
@ -757,9 +782,12 @@ GooseReceiver_startThreadless(GooseReceiver self)
else
self->ethSocket = Ethernet_createSocket(self->interfaceId, NULL);
Ethernet_setProtocolFilter(self->ethSocket, ETH_P_GOOSE);
self->running = true;
if (self->ethSocket != NULL) {
Ethernet_setProtocolFilter(self->ethSocket, ETH_P_GOOSE);
self->running = true;
}
else
self->running = false;
}
void
@ -770,7 +798,7 @@ GooseReceiver_stopThreadless(GooseReceiver self)
self->running = false;
}
// call after reception of ethernet frame and periodically to to house keeping tasks
// call after reception of ethernet frame
bool
GooseReceiver_tick(GooseReceiver self)
{

@ -92,7 +92,7 @@ void
GooseReceiver_start(GooseReceiver self);
/**
* \brief stop the GOOSE receiver running in a speparate thread
* \brief stop the GOOSE receiver running in a separate thread
*
* This function is used to stop the receiver thread started with GooseReceiver_start
*
@ -101,6 +101,14 @@ GooseReceiver_start(GooseReceiver self);
void
GooseReceiver_stop(GooseReceiver self);
bool
GooseReceiver_isRunning(GooseReceiver self);
/**
* \brief Free all resource of the GooseReceiver and all installed GooseSubscribers
*
* \param self the GooseReceiver instance
*/
void
GooseReceiver_destroy(GooseReceiver self);

@ -24,6 +24,7 @@
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#include <stdbool.h>
#pragma comment (lib, "Ws2_32.lib")
@ -104,6 +105,9 @@ Handleset_destroy(HandleSet self)
GLOBAL_FREEMEM(self);
}
static bool wsaStartupCalled = false;
static int socketCount = 0;
static void
activateKeepAlive(SOCKET s)
{
@ -162,19 +166,47 @@ prepareServerAddress(const char* address, int port, struct sockaddr_in* sockaddr
return true;
}
static bool wsaStartUp()
{
if (wsaStartupCalled == false) {
int ec;
WSADATA wsa;
if ((ec = WSAStartup(MAKEWORD(2, 0), &wsa)) != 0) {
if (DEBUG_SOCKET)
printf("WIN32_SOCKET: winsock error: code %i\n", ec);
return false;
}
else {
wsaStartupCalled = true;
return true;
}
}
else
return true;
}
static void wsaShutdown()
{
if (wsaStartupCalled) {
if (socketCount == 0) {
WSACleanup();
wsaStartupCalled = false;
}
}
}
ServerSocket
TcpServerSocket_create(const char* address, int port)
{
ServerSocket serverSocket = NULL;
int ec;
WSADATA wsa;
SOCKET listen_socket = INVALID_SOCKET;
if ((ec = WSAStartup(MAKEWORD(2,0), &wsa)) != 0) {
if (DEBUG_SOCKET)
printf("WIN32_SOCKET: winsock error: code %i\n", ec);
if (wsaStartUp() == false)
return NULL;
}
struct sockaddr_in server_addr;
@ -190,7 +222,9 @@ TcpServerSocket_create(const char* address, int port)
if (listen_socket == INVALID_SOCKET) {
if (DEBUG_SOCKET)
printf("WIN32_SOCKET: socket failed with error: %i\n", WSAGetLastError());
WSACleanup();
wsaShutdown();
return NULL;
}
@ -203,7 +237,9 @@ TcpServerSocket_create(const char* address, int port)
if (DEBUG_SOCKET)
printf("WIN32_SOCKET: bind failed with error:%i\n", WSAGetLastError());
closesocket(listen_socket);
WSACleanup();
wsaShutdown();
return NULL;
}
@ -214,6 +250,8 @@ TcpServerSocket_create(const char* address, int port)
setSocketNonBlocking((Socket) serverSocket);
socketCount++;
return serverSocket;
}
@ -252,8 +290,9 @@ void
ServerSocket_destroy(ServerSocket self)
{
closesocket(self->fd);
WSACleanup();
free(self);
socketCount--;
wsaShutdown();
GLOBAL_FREEMEM(self);
}
Socket
@ -264,6 +303,8 @@ TcpSocket_create()
self->fd = INVALID_SOCKET;
self->connectTimeout = 5000;
socketCount++;
return self;
}
@ -277,14 +318,10 @@ bool
Socket_connect(Socket self, const char* address, int port)
{
struct sockaddr_in serverAddress;
WSADATA wsa;
int ec;
if ((ec = WSAStartup(MAKEWORD(2,0), &wsa)) != 0) {
if (DEBUG_SOCKET)
printf("WIN32_SOCKET: winsock error: code %i\n", ec);
if (wsaStartUp() == false)
return false;
}
if (!prepareServerAddress(address, port, &serverAddress))
return false;
@ -401,5 +438,8 @@ Socket_destroy(Socket self)
closesocket(self->fd);
}
free(self);
socketCount--;
wsaShutdown();
GLOBAL_FREEMEM(self);
}

@ -149,6 +149,7 @@ ControlObjectClient_create(const char* objectReference, IedConnection connection
bool hasOper = false;
bool hasTimeActivatedControl = false;
bool hasCtlNum = false;
bool isAPC = false;
MmsVariableSpecification* ctlVal = NULL;
MmsVariableSpecification* t = NULL;
@ -157,7 +158,12 @@ ControlObjectClient_create(const char* objectReference, IedConnection connection
if (oper)
{
hasOper = true;
hasOper = true;
ctlVal = MmsVariableSpecification_getNamedVariableRecursive(oper, "ctlVal");
if (MmsVariableSpecification_getType(ctlVal) == MMS_STRUCTURE)
isAPC = true;
MmsVariableSpecification* operTm = MmsVariableSpecification_getNamedVariableRecursive(oper, "operTm");
@ -169,7 +175,6 @@ ControlObjectClient_create(const char* objectReference, IedConnection connection
if (ctlNum)
hasCtlNum = true;
ctlVal = MmsVariableSpecification_getNamedVariableRecursive(oper, "ctlVal");
t = MmsVariableSpecification_getNamedVariableRecursive(oper, "T");
}
}
@ -200,6 +205,11 @@ ControlObjectClient_create(const char* objectReference, IedConnection connection
self->hasCtlNum = hasCtlNum;
self->ctlVal = MmsValue_newDefaultValue(ctlVal);
if (isAPC)
self->analogValue = MmsValue_createEmptyStructure(1);
else
self->analogValue = NULL;
/* Check for T element type (Binary time -> Ed.1,UTC time -> Ed.2) */
if (MmsVariableSpecification_getType(t) == MMS_BINARY_TIME)
self->edition = 1;
@ -218,162 +228,6 @@ exit_function:
return self;
}
#if 0
ControlObjectClient
ControlObjectClient_create(const char* objectReference, IedConnection connection)
{
ControlObjectClient self = NULL;
/* request control model from server */
char domainId[65];
char itemId[129];
char* domainName = MmsMapping_getMmsDomainFromObjectReference(objectReference, domainId);
if (domainName == NULL)
goto exit_function;
convertToMmsAndInsertFC(itemId, objectReference + strlen(domainId) + 1, "CF");
int controlObjectItemIdLen = strlen(itemId);
strncat(itemId, "$ctlModel", 64 - controlObjectItemIdLen);
MmsError mmsError;
MmsValue* ctlModel = MmsConnection_readVariable(IedConnection_getMmsConnection(connection),
&mmsError, domainId, itemId);
if (ctlModel == NULL) {
if (DEBUG_IED_CLIENT)
printf("IED_CLIENT: ControlObjectClient_create: failed to get ctlModel from server\n");
goto exit_function;
}
int ctlModelVal = MmsValue_toUint32(ctlModel);
MmsValue_delete(ctlModel);
IedClientError error;
LinkedList dataDirectory =
IedConnection_getDataDirectory(connection, &error, objectReference);
if (dataDirectory == NULL) {
if (DEBUG_IED_CLIENT)
printf("IED_CLIENT: ControlObjectClient_create: failed to get data directory of control object\n");
goto exit_function;
}
/* check what control elements are available */
bool hasOper = false;
LinkedList element = LinkedList_getNext(dataDirectory);
while (element != NULL) {
char* objectName = (char*) element->data;
if (strcmp(objectName, "Oper") == 0)
hasOper = true;
element = LinkedList_getNext(element);
}
LinkedList_destroy(dataDirectory);
if (hasOper == false) {
if (DEBUG_IED_CLIENT)
printf("IED_CLIENT: control is missing required element \"Oper\"\n");
goto exit_function;
}
/* check for time activated control and ctlNum */
bool hasTimeActivatedControl = false;
bool hasCtlNum = false;
strcpy(itemId, objectReference);
strcat(itemId, ".Oper");
dataDirectory = IedConnection_getDataDirectory(connection, &error, itemId);
if (dataDirectory == NULL)
goto exit_function;
element = LinkedList_getNext(dataDirectory);
while (element != NULL) {
char* objectName = (char*) element->data;
if (strcmp(objectName, "operTm") == 0) {
hasTimeActivatedControl = true;
}
else if (strcmp(objectName, "ctlNum") == 0) {
hasCtlNum = true;
}
element = LinkedList_getNext(element);
}
LinkedList_destroy(dataDirectory);
/* get default parameters for Oper control variable */
MmsValue* oper = IedConnection_readObject(connection, &error, itemId, IEC61850_FC_CO);
if (oper == NULL) {
if (DEBUG_IED_CLIENT)
printf("IED_CLIENT: reading \"Oper\" failed!\n");
goto exit_function;
}
self = (ControlObjectClient) GLOBAL_CALLOC(1, sizeof(struct sControlObjectClient));
if (self == NULL)
goto exit_function;
self->objectReference = StringUtils_copyString(objectReference);
self->connection = connection;
self->ctlModel = (ControlModel) ctlModelVal;
self->hasTimeActivatedMode = hasTimeActivatedControl;
self->hasCtlNum = hasCtlNum;
self->ctlVal = MmsValue_getElement(oper, 0);
if (MmsValue_getType(self->ctlVal) == MMS_STRUCTURE)
self->analogValue = MmsValue_createEmptyStructure(1);
else
self->analogValue = NULL;
/* Check for T element type (Binary time -> Ed.1,UTC time -> Ed.2) */
MmsValue* t;
if (hasTimeActivatedControl)
t = MmsValue_getElement(oper, 4);
else
t = MmsValue_getElement(oper, 3);
if (MmsValue_getType(t) == MMS_BINARY_TIME)
self->edition = 1;
else
self->edition = 2;
if (DEBUG_IED_CLIENT)
printf("IED_CLIENT: Detected edition %i control\n", self->edition);
MmsValue_setElement(oper, 0, NULL);
MmsValue_delete(oper);
private_IedConnection_addControlClient(connection, self);
exit_function:
return self;
}
#endif
void
ControlObjectClient_destroy(ControlObjectClient self)
{

@ -32,12 +32,19 @@
#include "libiec61850_platform_includes.h"
static bool
isBufferedRcb(const char* objectReference)
isBufferedRcb(const char* objectReference, bool* isValid)
{
const char* separator = strchr(objectReference, '.');
if (separator == NULL)
separator = strchr(objectReference, '$');
if (separator == NULL) {
*isValid = false;
return false;
}
*isValid = true;
if (*(separator + 1) == 'B')
return true;
@ -48,12 +55,24 @@ isBufferedRcb(const char* objectReference)
ClientReportControlBlock
ClientReportControlBlock_create(const char* objectReference)
{
ClientReportControlBlock self = (ClientReportControlBlock) GLOBAL_CALLOC(1, sizeof(struct sClientReportControlBlock));
bool isReferenceValid;
bool isBuffered;
isBuffered = isBufferedRcb(objectReference, &isReferenceValid);
if (isReferenceValid == false) {
if (DEBUG_IED_CLIENT)
printf("DEBUG_IED_CLIENT: RCB reference invalid\n");
return NULL;
}
//TODO check validity of object reference?!
ClientReportControlBlock self = (ClientReportControlBlock) GLOBAL_CALLOC(1, sizeof(struct sClientReportControlBlock));
self->objectReference = StringUtils_copyString(objectReference);
self->isBuffered = isBufferedRcb(objectReference);
if (self) {
self->objectReference = StringUtils_copyString(objectReference);
self->isBuffered = isBuffered;
}
return self;
}

@ -1131,6 +1131,32 @@ IedConnection_getFileDirectory(IedConnection self, IedClientError* error, const
return fileNames;
}
LinkedList /*<FileDirectoryEntry>*/
IedConnection_getFileDirectoryEx(IedConnection self, IedClientError* error, const char* directoryName, const char* continueAfter,
bool* moreFollows)
{
*error = IED_ERROR_OK;
MmsError mmsError = MMS_ERROR_NONE;
LinkedList fileNames = LinkedList_create();
bool moreFollowsInternal = MmsConnection_getFileDirectory(self->connection, &mmsError, directoryName, continueAfter,
mmsFileDirectoryHandler, fileNames);
if (mmsError != MMS_ERROR_NONE) {
*error = iedConnection_mapMmsErrorToIedError(mmsError);
LinkedList_destroyDeep(fileNames, (LinkedListValueDeleteFunction) FileDirectoryEntry_destroy);
return NULL;
}
if (moreFollows != NULL)
*moreFollows = moreFollowsInternal;
return fileNames;
}
struct sClientProvidedFileReadHandler {
IedClientGetFileHandler handler;
@ -1201,6 +1227,13 @@ IedConnection_getFile(IedConnection self, IedClientError* error, const char* fil
return clientFileReadHandler.byteReceived;
}
void
IedConnection_setFilestoreBasepath(IedConnection self, const char* basepath)
{
/* simply pass the call to MMS client API */
MmsConnection_setFilestoreBasepath(self->connection, basepath);
}
void
IedConnection_setFile(IedConnection self, IedClientError* error, const char* sourceFilename, const char* destinationFilename)
{
@ -1948,13 +1981,9 @@ getDataDirectoryByFc(IedConnection self, IedClientError* error,
int elementNameLen = strlen(subElementName);
char* elementName = (char*) GLOBAL_MALLOC(elementNameLen + 5);
char* elementName = (char*) GLOBAL_MALLOC(elementNameLen + 1);
memcpy(elementName, subElementName, elementNameLen);
elementName[elementNameLen] = '[';
elementName[elementNameLen + 1] = *(fcPos + 1);
elementName[elementNameLen + 2] = *(fcPos + 2);
elementName[elementNameLen + 3] = ']';
elementName[elementNameLen + 4] = 0;
elementName[elementNameLen] = 0;
if (!addToStringSet(dataDirectory, elementName))
GLOBAL_FREEMEM(elementName);
@ -2297,6 +2326,64 @@ exit_function:
return dataSet;
}
void
IedConnection_writeDataSetValues(IedConnection self, IedClientError* error, const char* dataSetReference,
LinkedList/*<MmsValue*>*/ values, /* OUTPUT */LinkedList* /* <MmsValue*> */accessResults)
{
char domainIdBuffer[65];
char itemIdBuffer[DATA_SET_MAX_NAME_LENGTH + 1];
const char* domainId = NULL;
const char* itemId = NULL;
bool isAssociationSpecific = false;
if (dataSetReference[0] != '@') {
if ((dataSetReference[0] == '/') || (strchr(dataSetReference, '/') == NULL)) {
domainId = NULL;
if (dataSetReference[0] == '/')
itemId = dataSetReference + 1;
else
itemId = dataSetReference;
}
else {
domainId = MmsMapping_getMmsDomainFromObjectReference(dataSetReference, domainIdBuffer);
if (domainId == NULL) {
*error = IED_ERROR_OBJECT_REFERENCE_INVALID;
goto exit_function;
}
const char* itemIdRefOrig = dataSetReference + strlen(domainId) + 1;
if (strlen(itemIdRefOrig) > DATA_SET_MAX_NAME_LENGTH) {
*error = IED_ERROR_OBJECT_REFERENCE_INVALID;
goto exit_function;
}
char* itemIdRef = StringUtils_copyStringToBuffer(itemIdRefOrig, itemIdBuffer);
StringUtils_replace(itemIdRef, '.', '$');
itemId = itemIdRef;
}
}
else {
itemId = dataSetReference + 1;
isAssociationSpecific = true;
}
MmsError mmsError;
MmsConnection_writeNamedVariableList(self->connection, &mmsError, isAssociationSpecific, domainId, itemId, values, accessResults);
*error = iedConnection_mapMmsErrorToIedError(mmsError);
exit_function:
return;
}
LinkedList /* <MmsJournalEntry> */
IedConnection_queryLogByTime(IedConnection self, IedClientError* error, const char* logReference,
uint64_t startTime, uint64_t endTime, bool* moreFollows)

@ -405,6 +405,20 @@ Timestamp_setByMmsUtcTime(Timestamp* self, MmsValue* mmsValue)
memcpy(self->val, mmsValue->value.utcTime, 8);
}
MmsValue*
Timestamp_toMmsValue(Timestamp* self, MmsValue* mmsValue)
{
MmsValue* convertedValue = mmsValue;
if (convertedValue == NULL)
convertedValue = MmsValue_newUtcTime(0);
if (convertedValue != NULL)
memcpy(convertedValue->value.utcTime, self->val, 8);
return convertedValue;
}
char*
LibIEC61850_getVersionString()
{

@ -625,7 +625,7 @@ IedConnection_setGoCBValues(IedConnection self, IedClientError* error, ClientGoo
*
* The requested RCB has to be specified by its object reference. E.g.
*
* "simpleIOGernericIO/LLN0.RP.EventsRCB01"
* "simpleIOGenericIO/LLN0.RP.EventsRCB01"
*
* or
*
@ -810,6 +810,8 @@ IedConnection_uninstallReportHandler(IedConnection self, const char* rcbReferenc
*
* The RCB must have been enabled and GI set as trigger option before this command can be performed.
*
* \deprecated Use ClientReportControlBlock_setGI instead
*
* \param connection the connection object
* \param error the error code if an error occurs
* \param rcbReference object reference of the report control block
@ -1216,7 +1218,8 @@ IedConnection_readUnsigned32Value(IedConnection self, IedClientError* error, con
* \brief read a functional constrained data attribute (FCDA) of type Timestamp (UTC Time)
*
* NOTE: If the timestamp parameter is set to NULL the function allocates a new timestamp instance. Otherwise the
* return value is a pointer to the user provided timestamp instance.
* return value is a pointer to the user provided timestamp instance. The new timestamp instance has to be freed by
* the caller of the function.
*
* \param self the connection object to operate on
* \param error the error code if an error occurs
@ -1318,6 +1321,12 @@ IedConnection_writeOctetString(IedConnection self, IedClientError* error, const
/**
* \brief get data set values from a server device
*
* The parameter dataSetReference is the name of the data set to read. It is either in the form LDName/LNodeName.dataSetName
* for permanent domain or VMD scope data sets or @dataSetName for an association specific data set.
* If the LDName part of the reference is missing the resulting data set will be of VMD scope.
* The received data set values are stored in a container object of type ClientDataSet that can be reused in a further
* read request.
*
* \param connection the connection object
* \param error the error code if an error occurs
* \param dataSetReference object reference of the data set
@ -1383,6 +1392,26 @@ IedConnection_deleteDataSet(IedConnection self, IedClientError* error, const cha
LinkedList /* <char*> */
IedConnection_getDataSetDirectory(IedConnection self, IedClientError* error, const char* dataSetReference, bool* isDeletable);
/**
* \brief Write the data set values to the server
*
* The parameter dataSetReference is the name of the data set to write. It is either in the form LDName/LNodeName.dataSetName
* for permanent domain or VMD scope data sets or @dataSetName for an association specific data set.
* If the LDName part of the reference is missing the resulting data set will be of VMD scope.
* The values parameter has to be the same number of elements as are members in the data set. The accessResult return parameter
* contains a value for each data set member.
*
* \param connection the connection object
* \param error the error code if an error occurs
* \param dataSetReference object reference of the data set
* \param values the new data set values
* \param accessResults the access results for each data set member
*/
void
IedConnection_writeDataSetValues(IedConnection self, IedClientError* error, const char* dataSetReference,
LinkedList/*<MmsValue*>*/ values, /* OUTPUT */LinkedList* /* <MmsValue*> */accessResults);
/********************************************************
* Data set object (local representation of a data set)
*******************************************************/
@ -1637,13 +1666,12 @@ IedConnection_getServerDirectory(IedConnection self, IedClientError* error, bool
/**
* \brief Get the list of logical nodes (LN) of a logical device
*
* LGetLogicalDeviceDirectory ACSI service implementation. Returns the list of logical nodes present
* in a logical device. The list is returned as a linked list of type LinkedList where the elements
* are C style strings.
* GetLogicalDeviceDirectory ACSI service implementation. Returns the list of logical nodes names present
* in a logical device. The list is returned as a linked list of type LinkedList with c style string elements.
*
* \param self the connection object
* \param error the error code if an error occurs
* \param getFileNames get list of files instead of logical device names (TO BE IMPLEMENTED)
* \param logicalDeviceName the name of the logical device (LD) of interest
*
* \return LinkedList with string elements representing the logical node names
*/
@ -1738,8 +1766,10 @@ IedConnection_getDataDirectoryFC(IedConnection self, IedClientError* error, cons
* \brief returns the directory of the given data object/data attribute with the given FC
*
* Implementation of the GetDataDirectory ACSI service. This will return the list of
* C strings with all data attributes or sub data objects as elements. The returned
* strings will contain the functional constraint appended in square brackets when appropriate.
* C strings with all data attributes or sub data objects as elements.
*
* WARNING: Starting with version 1.0.3 the functional constraint will no longer be appended to
* the name string.
*
* \param self the connection object
* \param error the error code if an error occurs
@ -1869,6 +1899,38 @@ FileDirectoryEntry_getLastModified(FileDirectoryEntry self);
LinkedList /*<FileDirectoryEntry>*/
IedConnection_getFileDirectory(IedConnection self, IedClientError* error, const char* directoryName);
/**
* \brief returns the directory entries of the specified file directory returned by a single file directory request.
*
* This function will only create a single request and the result may only be the directory that fits
* into a single MMS PDU. If the server contains more directory entries, this will be indicated by setting
* the moreFollows variable (if provided by the caller). If the directory entry does not fit into a single MMS
* PDU the next part of the directory list can be requested by setting the continueAfter parameter with the value
* of the last filename of the received list.
*
* Requires the server to support file services.
*
* NOTE: the returned linked list has to be freed by the user. You can user the following statement
* to free the list of directory entries:
*
* LinkedList_destroyDeep(fileNames, (LinkedListValueDeleteFunction) FileDirectoryEntry_destroy);
*
* where fileNames is the return value of this function.
*
* \param self the connection object
* \param error the error code if an error occurs
* \param directoryName the name of the directory or NULL to get the entries of the root directory
* \param continueAfter last received filename to continue after, or NULL for the first request
* \param moreFollows if provided by the caller (non NULL) the function will indicate if more directory entries
* are available.
*
* \return the list of directory entries. The return type is a LinkedList with FileDirectoryEntry elements
*/
LinkedList /*<FileDirectoryEntry>*/
IedConnection_getFileDirectoryEx(IedConnection self, IedClientError* error, const char* directoryName, const char* continueAfter,
bool* moreFollows);
/**
* \brief user provided handler to receive the data of the GetFile request
*
@ -1901,6 +1963,19 @@ uint32_t
IedConnection_getFile(IedConnection self, IedClientError* error, const char* fileName, IedClientGetFileHandler handler,
void* handlerParameter);
/**
* \brief Set the virtual filestore basepath for the setFile service
*
* All external file service accesses will be mapped to paths relative to the base directory.
* NOTE: This function is only available when the CONFIG_SET_FILESTORE_BASEPATH_AT_RUNTIME
* option in stack_config.h is set.
*
* \param self the connection object
* \param basepath the new virtual filestore basepath
*/
void
IedConnection_setFilestoreBasepath(IedConnection, const char* basepath);
/**
* \brief Implementation of the SetFile ACSI service
*

@ -406,6 +406,15 @@ Timestamp_setTimeInMilliseconds(Timestamp* self, uint64_t millisSinceEpoch);
void
Timestamp_setByMmsUtcTime(Timestamp* self, MmsValue* mmsValue);
/**
* \brief Set an MmsValue instance of type UTCTime to the timestamp value
*
* \param self the Timestamp instance
* \param mmsValue the mmsValue instance, if NULL a new instance will be created
*/
MmsValue*
Timestamp_toMmsValue(Timestamp* self, MmsValue* mmsValue);
/**
* \brief Get the version of the library as string
*

@ -151,7 +151,8 @@ typedef enum {
GENERIC_BITSTRING = 26,
CONSTRUCTED = 27,
ENTRY_TIME = 28,
PHYCOMADDR = 29
PHYCOMADDR = 29,
CURRENCY = 30
#endif
} DataAttributeType;
@ -388,7 +389,11 @@ char*
ModelNode_getObjectReference(ModelNode* self, char* objectReference);
/**
* \brief Get the type of the ModelNode
*
* \param self the ModelNode instance
*
* \return the type of the ModelNode (one of LD, LN, DO, DA)
*/
ModelNodeType
ModelNode_getType(ModelNode* self);
@ -412,13 +417,13 @@ IedModel_setIedName(IedModel* self, const char* iedName);
* as it happens to appear on the wire. E.g. if IED name in SCL file would be "IED1"
* and the logical device "WD1" the resulting LD name would be "IED1WD".
*
* \param model the IedModel instance that holds the model node
* \param self the IedModel instance that holds the model node
* \param objectReference the IEC 61850 object reference
*
* \return the model node instance or NULL if model node does not exist.
*/
ModelNode*
IedModel_getModelNodeByObjectReference(IedModel* model, const char* objectReference);
IedModel_getModelNodeByObjectReference(IedModel* self, const char* objectReference);
SVControlBlock*
IedModel_getSVControlBlock(IedModel* self, LogicalNode* parentLN, const char* svcbName);
@ -430,13 +435,13 @@ IedModel_getSVControlBlock(IedModel* self, LogicalNode* parentLN, const char* sv
* IED name as part of the logical device name. This function is useful for
* devices where the IED name can be configured.
*
* \param model the IedModel instance that holds the model node
* \param self the IedModel instance that holds the model node
* \param objectReference the IEC 61850 object reference
*
* \return the model node instance or NULL if model node does not exist.
*/
ModelNode*
IedModel_getModelNodeByShortObjectReference(IedModel* model, const char* objectReference);
IedModel_getModelNodeByShortObjectReference(IedModel* self, const char* objectReference);
/**
* \brief Lookup a model node by its short address
@ -444,13 +449,25 @@ IedModel_getModelNodeByShortObjectReference(IedModel* model, const char* objectR
* Short address is a 32 bit unsigned integer as specified in the "sAddr" attribute of
* the ICD file or in the configuration file.
*
* \param model the IedModel instance that holds the model node
* \param self the IedModel instance that holds the model node
* \param shortAddress
*
* \return the model node instance or NULL if model node does not exist.
*/
ModelNode*
IedModel_getModelNodeByShortAddress(IedModel* model, uint32_t shortAddress);
IedModel_getModelNodeByShortAddress(IedModel* self, uint32_t shortAddress);
/**
* \brief Lookup logical device (LD) by device instance name (SCL attribute "inst")
*
* \param self IedModel instance
* \param ldInst the logical device instance name (SCL attribute "inst")
*
* \return The matching LogicalDevice instance
*/
LogicalDevice*
IedModel_getDeviceByInst(IedModel* self, const char* ldInst);
/**
* \brief Lookup a logical node by name that is part of the given logical device
@ -461,7 +478,7 @@ IedModel_getModelNodeByShortAddress(IedModel* model, uint32_t shortAddress);
* \return the logical device instance or NULL if it does not exist
*/
LogicalNode*
LogicalDevice_getLogicalNode(LogicalDevice* device, const char* lnName);
LogicalDevice_getLogicalNode(LogicalDevice* self, const char* lnName);
/**
* \brief Get the setting group control block (SGCB) of the logical device
@ -471,7 +488,7 @@ LogicalDevice_getLogicalNode(LogicalDevice* device, const char* lnName);
* \return the SGCB instance or NULL if no SGCB is available
*/
SettingGroupControlBlock*
LogicalDevice_getSettingGroupControlBlock(LogicalDevice* device);
LogicalDevice_getSettingGroupControlBlock(LogicalDevice* self);
/**@}*/
@ -481,37 +498,69 @@ LogicalDevice_getSettingGroupControlBlock(LogicalDevice* device);
/**
* \brief unset all MmsValue references in the data model
*
* \param model the IedModel instance that holds the model node
* \param self the IedModel instance that holds the model node
*/
void
IedModel_setAttributeValuesToNull(IedModel* iedModel);
IedModel_setAttributeValuesToNull(IedModel* self);
/**
* \brief Lookup logical device (LD) by device name
*
* \param self IedModel instance
* \param ldInst the logical device name (as it is seen from the protocol side - MMS domain name)
*
* \return The matching LogicalDevice instance
*/
LogicalDevice*
IedModel_getDevice(IedModel* model, const char* deviceName);
IedModel_getDevice(IedModel* self, const char* ldName);
/*
* \param dataSetReference MMS mapping object reference! e.g. ied1Inverter/LLN0$dataset1
/**
* \brief Lookup a data set in the IED model
*
* \param self IedModel instance
* \param dataSetReference MMS mapping object reference! e.g. ied1Inverter/LLN0$dataset1
*
* \return The matching DataSet instance
*/
DataSet*
IedModel_lookupDataSet(IedModel* model, const char* dataSetReference);
IedModel_lookupDataSet(IedModel* self, const char* dataSetReference);
/**
* \brief Lookup a DataAttribute instance with the corresponding MmsValue instance
*
* \param self IedModel instance
* \param value the MmsValue instance (from the MMS value cache)
*
* \return the matching DataAttribute instance
*/
DataAttribute*
IedModel_lookupDataAttributeByMmsValue(IedModel* self, MmsValue* value);
/**
* \brief Get the number of logical devices
*
* \param self IedModel instance
*
* \return the number of logical devices
*/
int
IedModel_getLogicalDeviceCount(IedModel* iedModel);
IedModel_getLogicalDeviceCount(IedModel* self);
int
LogicalDevice_getLogicalNodeCount(LogicalDevice* logicalDevice);
LogicalDevice_getLogicalNodeCount(LogicalDevice* self);
ModelNode*
LogicalDevice_getChildByMmsVariableName(LogicalDevice* logicalDevice, const char* mmsVariableName);
LogicalDevice_getChildByMmsVariableName(LogicalDevice* self, const char* mmsVariableName);
bool
LogicalNode_hasFCData(LogicalNode* node, FunctionalConstraint fc);
LogicalNode_hasFCData(LogicalNode* self, FunctionalConstraint fc);
bool
LogicalNode_hasBufferedReports(LogicalNode* node);
LogicalNode_hasBufferedReports(LogicalNode* self);
bool
LogicalNode_hasUnbufferedReports(LogicalNode* node);
LogicalNode_hasUnbufferedReports(LogicalNode* self);
/**
* \brief get a data set instance
@ -525,10 +574,8 @@ DataSet*
LogicalNode_getDataSet(LogicalNode* self, const char* dataSetName);
bool
DataObject_hasFCData(DataObject* dataObject, FunctionalConstraint fc);
DataObject_hasFCData(DataObject* self, FunctionalConstraint fc);
DataAttribute*
IedModel_lookupDataAttributeByMmsValue(IedModel* model, MmsValue* value);
#ifdef __cplusplus
}

@ -76,6 +76,28 @@ IedServer_create(IedModel* iedModel);
void
IedServer_destroy(IedServer self);
/**
* \brief Set the local IP address to listen on
*
* \param self the IedServer instance
* \param localIpAddress the local IP address as C string (an internal copy will be created)
*/
void
IedServer_setLocalIpAddress(IedServer self, const char* localIpAddress);
/**
* \brief Set the virtual filestore basepath for the MMS file services
*
* All external file service accesses will be mapped to paths relative to the base directory.
* NOTE: This function is only available when the CONFIG_SET_FILESTORE_BASEPATH_AT_RUNTIME
* option in stack_config.h is set.
*
* \param self the IedServer instance
* \param basepath the new virtual filestore basepath
*/
void
IedServer_setFilestoreBasepath(IedServer self, const char* basepath);
/**
* \brief Start handling client connections
*
@ -106,6 +128,19 @@ IedServer_stop(IedServer self);
void
IedServer_startThreadless(IedServer self, int tcpPort);
/**
* \brief Wait until a server connection is ready (with timeout)
*
* The function will wait until a server connection is ready (data available) or the
* timeout elapsed. This function is intended for the non-threaded mode. Its use is optional.
* It is equivalent of using select on sockets on Linux. If the return value is != 0 the
* IedServer_processIncomingData function should be called.
*
* \param self the IedServer instance
* \param timeoutMs the timeout to wait when no connection is ready
*
* \return 0 if no connection is ready; otherwise at least one connection is ready
*/
int
IedServer_waitReady(IedServer self, unsigned int timeoutMs);
@ -525,6 +560,21 @@ IedServer_updateFloatAttributeValue(IedServer self, DataAttribute* dataAttribute
void
IedServer_updateInt32AttributeValue(IedServer self, DataAttribute* dataAttribute, int32_t value);
/**
* \brief Update the value of an IEC 61850 Dbpos (double point/position) data attribute.
*
* Update the value of a integer data attribute without handling with MmsValue instances.
*
* This function will also check if a trigger condition is satisfied in the case when a report or GOOSE
* control block is enabled.
*
* \param self the instance of IedServer to operate on.
* \param dataAttribute the data attribute handle
* \param value the new Dbpos value of the data attribute.
*/
void
IedServer_udpateDbposValue(IedServer self, DataAttribute* dataAttribute, Dbpos value);
/**
* \brief Update the value of an IEC 61850 integer64 data attribute (like BCR actVal)
*
@ -785,7 +835,8 @@ typedef enum {
CONTROL_HARDWARE_FAULT = 1, /** check failed due to hardware fault */
CONTROL_TEMPORARILY_UNAVAILABLE = 2, /** control is already selected or operated */
CONTROL_OBJECT_ACCESS_DENIED = 3, /** check failed due to access control reason - access denied for this client or state */
CONTROL_OBJECT_UNDEFINED = 4 /** object not visible in this security context ??? */
CONTROL_OBJECT_UNDEFINED = 4, /** object not visible in this security context ??? */
CONTROL_VALUE_INVALID = 11 /** ctlVal out of range */
} CheckHandlerResult;
/**

@ -39,6 +39,7 @@ struct sIedServer
MmsDevice* mmsDevice;
MmsServer mmsServer;
IsoServer isoServer;
char* localIpAddress;
MmsMapping* mmsMapping;
LinkedList clientConnections;
uint8_t writeAccessPolicies;

@ -405,6 +405,7 @@ IedServer_create(IedModel* iedModel)
self->model = iedModel;
// self->running = false; /* not required due to CALLOC */
// self->localIpAddress = NULL; /* not required due to CALLOC */
#if (CONFIG_MMS_THREADLESS_STACK != 1)
self->dataModelLock = Semaphore_create(1);
@ -464,6 +465,9 @@ IedServer_destroy(IedServer self)
MmsServer_destroy(self->mmsServer);
IsoServer_destroy(self->isoServer);
if (self->localIpAddress != NULL)
GLOBAL_FREEMEM(self->localIpAddress);
#if ((CONFIG_MMS_SINGLE_THREADED == 1) && (CONFIG_MMS_THREADLESS_STACK == 0))
/* trigger stopping background task thread */
@ -600,6 +604,23 @@ IedServer_stop(IedServer self)
}
#endif /* (CONFIG_MMS_THREADLESS_STACK != 1) */
void
IedServer_setFilestoreBasepath(IedServer self, const char* basepath)
{
/* simply pass to MMS server API */
MmsServer_setFilestoreBasepath(self->mmsServer, basepath);
}
void
IedServer_setLocalIpAddress(IedServer self, const char* localIpAddress)
{
if (self->localIpAddress != NULL)
GLOBAL_FREEMEM(self->localIpAddress);
self->localIpAddress = StringUtils_copyString(localIpAddress);
IsoServer_setLocalIpAddress(self->isoServer, self->localIpAddress);
}
void
IedServer_startThreadless(IedServer self, int tcpPort)
@ -964,6 +985,27 @@ IedServer_updateInt32AttributeValue(IedServer self, DataAttribute* dataAttribute
}
}
void
IedServer_udpateDbposValue(IedServer self, DataAttribute* dataAttribute, Dbpos value)
{
Dbpos currentValue = Dbpos_fromMmsValue(dataAttribute->mmsValue);
if (currentValue == value) {
checkForUpdateTrigger(self, dataAttribute);
}
else {
#if (CONFIG_MMS_THREADLESS_STACK != 1)
Semaphore_wait(self->dataModelLock);
#endif
Dbpos_toMmsValue(dataAttribute->mmsValue, value);
#if (CONFIG_MMS_THREADLESS_STACK != 1)
Semaphore_post(self->dataModelLock);
#endif
checkForChangedTriggers(self, dataAttribute);
}
}
void
IedServer_updateInt64AttributeValue(IedServer self, DataAttribute* dataAttribute, int64_t value)
{
@ -1253,8 +1295,13 @@ IedServer_setWriteAccessPolicy(IedServer self, FunctionalConstraint fc, AccessPo
void
IedServer_handleWriteAccess(IedServer self, DataAttribute* dataAttribute, WriteAccessHandler handler, void* parameter)
{
if (dataAttribute == NULL)
*((int*) NULL) = 1;
if (dataAttribute == NULL) {
if (DEBUG_IED_SERVER)
printf("IED_SERVER: IedServer_handleWriteAccess - dataAttribute == NULL!\n");
/* Cause a trap */
*((volatile int*) NULL) = 1;
}
MmsMapping_installWriteAccessHandler(self->mmsMapping, dataAttribute, handler, parameter);
}

@ -1211,27 +1211,6 @@ checkValidityOfOriginParameter(MmsValue* origin)
return true;
}
static MmsDataAccessError
getDataAccessErrorFromCheckHandlerResult(CheckHandlerResult checkResult)
{
MmsDataAccessError indication;
if (checkResult == CONTROL_HARDWARE_FAULT)
indication = DATA_ACCESS_ERROR_HARDWARE_FAULT;
else
if (checkResult == CONTROL_TEMPORARILY_UNAVAILABLE)
indication = DATA_ACCESS_ERROR_TEMPORARILY_UNAVAILABLE;
else
if (checkResult == CONTROL_OBJECT_UNDEFINED)
indication = DATA_ACCESS_ERROR_OBJECT_UNDEFINED;
else if (checkResult == CONTROL_OBJECT_ACCESS_DENIED)
indication = DATA_ACCESS_ERROR_OBJECT_ACCESS_DENIED;
else
indication = DATA_ACCESS_ERROR_SUCCESS;
return indication;
}
MmsDataAccessError
Control_writeAccessControlObject(MmsMapping* self, MmsDomain* domain, char* variableIdOrig,
MmsValue* value, MmsServerConnection connection)
@ -1378,7 +1357,7 @@ Control_writeAccessControlObject(MmsMapping* self, MmsDomain* domain, char* vari
printf("SBOw: selected successful\n");
}
else {
indication = getDataAccessErrorFromCheckHandlerResult(checkResult);
indication = (MmsDataAccessError) checkResult;
ControlObject_sendLastApplError(controlObject, connection, "SBOw", 0,
ADD_CAUSE_SELECT_FAILED, ctlNum, origin, true);
@ -1523,7 +1502,7 @@ Control_writeAccessControlObject(MmsMapping* self, MmsDomain* domain, char* vari
}
else {
indication = getDataAccessErrorFromCheckHandlerResult(checkResult);
indication = (MmsDataAccessError) checkResult;
abortControlOperation(controlObject);
}

@ -882,7 +882,7 @@ Logging_processIntegrityLogs(MmsMapping* self, uint64_t currentTimeInMs)
if (currentTimeInMs >= logControl->nextIntegrityScan) {
//if (DEBUG_IED_SERVER)
if (DEBUG_IED_SERVER)
printf("IED_SERVER: INTEGRITY SCAN for log %s\n", logControl->name);
LogControl_logAllDatasetEntries(logControl, self->mmsDevice->deviceName);

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save