- fixed DPC status bug in demo

pull/521/head
Michael Zillgith 1 year ago
parent 98649acc88
commit 4e751caf1c

@ -9,9 +9,9 @@
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char** argv) {
char* hostname;
int main(int argc, char **argv)
{
char *hostname;
int tcpPort = 102;
if (argc > 1)
@ -28,72 +28,81 @@ int main(int argc, char** argv) {
IedConnection_connect(con, &error, hostname, tcpPort);
if (error == IED_ERROR_OK) {
if (error == IED_ERROR_OK)
{
/************************
* Direct control
***********************/
bool led4State = false;
ControlObjectClient controlLED1
= ControlObjectClient_create("beagleGenericIO/GGIO1.SPCSO1", con);
ControlObjectClient controlLED1 = ControlObjectClient_create("beagleGenericIO/GGIO1.SPCSO1", con);
ControlObjectClient controlLED2
= ControlObjectClient_create("beagleGenericIO/GGIO1.SPCSO2", con);
ControlObjectClient controlLED2 = ControlObjectClient_create("beagleGenericIO/GGIO1.SPCSO2", con);
ControlObjectClient controlLED3
= ControlObjectClient_create("beagleGenericIO/GGIO1.SPCSO3", con);
ControlObjectClient controlLED3 = ControlObjectClient_create("beagleGenericIO/GGIO1.SPCSO3", con);
ControlObjectClient controlLED4
= ControlObjectClient_create("beagleGenericIO/GGIO1.DPCSO1", con);
ControlObjectClient controlLED4 = ControlObjectClient_create("beagleGenericIO/GGIO1.DPCSO1", con);
MmsValue* ctlValOn = MmsValue_newBoolean(true);
MmsValue *ctlValOn = MmsValue_newBoolean(true);
MmsValue* ctlValOff = MmsValue_newBoolean(false);
MmsValue *ctlValOff = MmsValue_newBoolean(false);
if (!ControlObjectClient_operate(controlLED1, ctlValOff, 0)) goto control_error;
if (!ControlObjectClient_operate(controlLED1, ctlValOff, 0))
goto control_error;
ControlObjectClient_select(controlLED2);
if (!ControlObjectClient_operate(controlLED2, ctlValOff, 0)) goto control_error;
if (!ControlObjectClient_operate(controlLED4, ctlValOff, 0)) goto control_error;
while (1) {
if (!ControlObjectClient_operate(controlLED3, ctlValOff, 0)) goto control_error;
if (!ControlObjectClient_operate(controlLED1, ctlValOn, 0)) goto control_error;
if (!ControlObjectClient_operate(controlLED2, ctlValOff, 0))
goto control_error;
if (!ControlObjectClient_operate(controlLED4, ctlValOff, 0))
goto control_error;
while (1)
{
if (!ControlObjectClient_operate(controlLED3, ctlValOff, 0))
goto control_error;
if (!ControlObjectClient_operate(controlLED1, ctlValOn, 0))
goto control_error;
Thread_sleep(1000);
if (!ControlObjectClient_operate(controlLED1, ctlValOff, 0)) goto control_error;
if (!ControlObjectClient_operate(controlLED1, ctlValOff, 0))
goto control_error;
ControlObjectClient_select(controlLED2);
if (!ControlObjectClient_operate(controlLED2, ctlValOn, 0)) goto control_error;
if (!ControlObjectClient_operate(controlLED2, ctlValOn, 0))
goto control_error;
Thread_sleep(1000);
ControlObjectClient_select(controlLED2);
if (!ControlObjectClient_operate(controlLED2, ctlValOff, 0)) goto control_error;
if (!ControlObjectClient_operate(controlLED2, ctlValOff, 0))
goto control_error;
if (!ControlObjectClient_operate(controlLED3, ctlValOn, 0)) goto control_error;
if (!ControlObjectClient_operate(controlLED3, ctlValOn, 0))
goto control_error;
Thread_sleep(1000);
if (led4State == false) {
if (!ControlObjectClient_operate(controlLED4, ctlValOn, 0)) goto control_error;
if (led4State == false)
{
if (!ControlObjectClient_operate(controlLED4, ctlValOn, 0))
goto control_error;
led4State = true;
}
else {
if (!ControlObjectClient_operate(controlLED4, ctlValOff, 0)) goto control_error;
else
{
if (!ControlObjectClient_operate(controlLED4, ctlValOff, 0))
goto control_error;
led4State = false;
}
}
goto exit_control_loop;
control_error:
control_error:
printf("Error controlling device!\n");
exit_control_loop:
exit_control_loop:
MmsValue_delete(ctlValOn);
MmsValue_delete(ctlValOff);
@ -105,11 +114,10 @@ exit_control_loop:
IedConnection_close(con);
}
else {
printf("Connection failed!\n");
else
{
printf("Connection failed!\n");
}
IedConnection_destroy(con);
}

@ -2,7 +2,6 @@
* beagle_demo.c
*
* This demo shows how to connect the libiec61850 server stack to a real device.
*
*/
#include "iec61850_server.h"
@ -31,21 +30,24 @@ static uint32_t dpcState = 0;
void sigint_handler(int signalId)
{
running = 0;
running = 0;
}
static void
connectionIndicationHandler(IedServer server, ClientConnection connection, bool connected, void* parameter)
connectionIndicationHandler(IedServer server, ClientConnection connection, bool connected, void *parameter)
{
const char* clientAddress = ClientConnection_getPeerAddress(connection);
const char *clientAddress = ClientConnection_getPeerAddress(connection);
if (connected) {
if (connected)
{
printf("BeagleDemoServer: new client connection from %s\n", clientAddress);
}
else {
else
{
printf("BeagleDemoServer: client connection from %s closed\n", clientAddress);
if (controllingClient == connection) {
if (controllingClient == connection)
{
printf("Controlling client has closed connection -> switch to automatic operation mode\n");
controllingClient = NULL;
automaticOperationMode = true;
@ -54,9 +56,10 @@ connectionIndicationHandler(IedServer server, ClientConnection connection, bool
}
static CheckHandlerResult
performCheckHandler(ControlAction action, void* parameter, MmsValue* ctlVal, bool test, bool interlockCheck, ClientConnection connection)
performCheckHandler(ControlAction action, void *parameter, MmsValue *ctlVal, bool test, bool interlockCheck, ClientConnection connection)
{
if (controllingClient == NULL) {
if (controllingClient == NULL)
{
printf("Client takes control -> switch to remote control operation mode\n");
controllingClient = connection;
automaticOperationMode = false;
@ -74,7 +77,8 @@ performCheckHandler(ControlAction action, void* parameter, MmsValue* ctlVal, boo
}
static void
updateLED1stVal(bool newLedState, uint64_t timeStamp) {
updateLED1stVal(bool newLedState, uint64_t timeStamp)
{
switchLED(LED1, newLedState);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1_t, timeStamp);
@ -83,7 +87,8 @@ updateLED1stVal(bool newLedState, uint64_t timeStamp) {
}
static void
updateLED2stVal(bool newLedState, uint64_t timeStamp) {
updateLED2stVal(bool newLedState, uint64_t timeStamp)
{
switchLED(LED2, newLedState);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO2_t, timeStamp);
@ -92,7 +97,8 @@ updateLED2stVal(bool newLedState, uint64_t timeStamp) {
}
static void
updateLED3stVal(bool newLedState, uint64_t timeStamp) {
updateLED3stVal(bool newLedState, uint64_t timeStamp)
{
switchLED(LED3, newLedState);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO3_t, timeStamp);
@ -101,7 +107,7 @@ updateLED3stVal(bool newLedState, uint64_t timeStamp) {
}
static ControlHandlerResult
controlHandlerForBinaryOutput(ControlAction action, void* parameter, MmsValue* value, bool test)
controlHandlerForBinaryOutput(ControlAction action, void *parameter, MmsValue *value, bool test)
{
if (test)
return CONTROL_RESULT_OK;
@ -117,30 +123,32 @@ controlHandlerForBinaryOutput(ControlAction action, void* parameter, MmsValue* v
updateLED2stVal(newState, timeStamp);
if (parameter == IEDMODEL_GenericIO_GGIO1_SPCSO3)
updateLED3stVal(newState, timeStamp);
updateLED3stVal(newState, timeStamp);
if (parameter == IEDMODEL_GenericIO_GGIO1_DPCSO1) { /* example for Double Point Control - DPC */
if (parameter == IEDMODEL_GenericIO_GGIO1_DPCSO1) /* example for Double Point Control - DPC */
{
Dbpos dpcState = DBPOS_INTERMEDIATE_STATE;
dpcState = 0; /* DPC_STATE_INTERMEDIATE */
IedServer_updateBitStringAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_DPCSO1_stVal, dpcState);
IedServer_updateDbposValue(iedServer, IEDMODEL_GenericIO_GGIO1_DPCSO1_stVal, dpcState);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_DPCSO1_t, timeStamp);
if (newState) {
if (newState)
{
flashLED(LED4);
Thread_sleep(3000);
switchLED(LED4, 1);
dpcState = 2; /* DPC_STATE_ON */
dpcState = DBPOS_ON;
}
else {
else
{
flashLED(LED4);
Thread_sleep(3000);
switchLED(LED4, 0);
dpcState = 1; /* DPC_STATE_OFF */
dpcState = DBPOS_OFF;
}
IedServer_updateBitStringAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_DPCSO1_stVal, dpcState);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_DPCSO1_t, timeStamp);
IedServer_updateDbposValue(iedServer, IEDMODEL_GenericIO_GGIO1_DPCSO1_stVal, dpcState);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_DPCSO1_t, Hal_getTimeInMs());
}
return CONTROL_RESULT_OK;
@ -151,29 +159,28 @@ static int ledOffTimeMs = 1000;
static int32_t opCnt = 0;
static ControlHandlerResult
controlHandlerForInt32Controls(ControlAction action, void* parameter, MmsValue* value, bool test)
controlHandlerForInt32Controls(ControlAction action, void *parameter, MmsValue *value, bool test)
{
if (test)
return CONTROL_RESULT_OK;
if (test)
return CONTROL_RESULT_OK;
if (parameter == IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs) {
int32_t newValue = MmsValue_toInt32(value);
if (parameter == IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs)
{
int32_t newValue = MmsValue_toInt32(value);
opCnt = newValue;
opCnt = newValue;
uint64_t currentTime = Hal_getTimeInMs();
uint64_t currentTime = Hal_getTimeInMs();
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs_t, currentTime);
IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs_stVal, opCnt);
}
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs_t, currentTime);
IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs_stVal, opCnt);
}
return CONTROL_RESULT_OK;
return CONTROL_RESULT_OK;
}
static MmsDataAccessError
int32WriteAccessHandler (DataAttribute* dataAttribute, MmsValue* value, ClientConnection connection, void* parameter)
int32WriteAccessHandler(DataAttribute *dataAttribute, MmsValue *value, ClientConnection connection, void *parameter)
{
int newValue = MmsValue_toInt32(value);
@ -181,8 +188,8 @@ int32WriteAccessHandler (DataAttribute* dataAttribute, MmsValue* value, ClientCo
if (newValue < 0)
return DATA_ACCESS_ERROR_OBJECT_VALUE_INVALID;
if (dataAttribute == IEDMODEL_GenericIO_TIM_GAPC1_OpDlTmms_setVal) {
if (dataAttribute == IEDMODEL_GenericIO_TIM_GAPC1_OpDlTmms_setVal)
{
printf("New value for TIM_GAPC1.OpDlTmms.setVal = %i\n", newValue);
ledOffTimeMs = newValue;
@ -190,8 +197,8 @@ int32WriteAccessHandler (DataAttribute* dataAttribute, MmsValue* value, ClientCo
return DATA_ACCESS_ERROR_SUCCESS;
}
if (dataAttribute == IEDMODEL_GenericIO_TIM_GAPC1_RsDlTmms_setVal) {
if (dataAttribute == IEDMODEL_GenericIO_TIM_GAPC1_RsDlTmms_setVal)
{
printf("New value for TIM_GAPC1.RsDlTmms.setVal = %i\n", newValue);
ledOnTimeMs = newValue;
@ -202,130 +209,130 @@ int32WriteAccessHandler (DataAttribute* dataAttribute, MmsValue* value, ClientCo
return DATA_ACCESS_ERROR_OBJECT_ACCESS_DENIED;
}
int main(int argc, char** argv) {
int main(int argc, char **argv)
{
initLEDs();
iedServer = IedServer_create(&iedModel);
iedServer = IedServer_create(&iedModel);
/* Set control callback handlers */
IedServer_setConnectionIndicationHandler(iedServer, (IedConnectionIndicationHandler) connectionIndicationHandler, NULL);
/* Set control callback handlers */
IedServer_setConnectionIndicationHandler(iedServer, (IedConnectionIndicationHandler)connectionIndicationHandler, NULL);
IedServer_setPerformCheckHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1,
(ControlPerformCheckHandler) performCheckHandler, IEDMODEL_GenericIO_GGIO1_SPCSO1);
IedServer_setPerformCheckHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1,
(ControlPerformCheckHandler)performCheckHandler, IEDMODEL_GenericIO_GGIO1_SPCSO1);
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1, (ControlHandler) controlHandlerForBinaryOutput,
IEDMODEL_GenericIO_GGIO1_SPCSO1);
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO1, (ControlHandler)controlHandlerForBinaryOutput,
IEDMODEL_GenericIO_GGIO1_SPCSO1);
IedServer_setPerformCheckHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO2,
(ControlPerformCheckHandler) performCheckHandler, IEDMODEL_GenericIO_GGIO1_SPCSO2);
(ControlPerformCheckHandler)performCheckHandler, IEDMODEL_GenericIO_GGIO1_SPCSO2);
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO2, (ControlHandler) controlHandlerForBinaryOutput,
IEDMODEL_GenericIO_GGIO1_SPCSO2);
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO2, (ControlHandler)controlHandlerForBinaryOutput,
IEDMODEL_GenericIO_GGIO1_SPCSO2);
IedServer_setPerformCheckHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO3,
(ControlPerformCheckHandler) performCheckHandler, IEDMODEL_GenericIO_GGIO1_SPCSO3);
(ControlPerformCheckHandler)performCheckHandler, IEDMODEL_GenericIO_GGIO1_SPCSO3);
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO3, (ControlHandler) controlHandlerForBinaryOutput,
IEDMODEL_GenericIO_GGIO1_SPCSO3);
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_SPCSO3, (ControlHandler)controlHandlerForBinaryOutput,
IEDMODEL_GenericIO_GGIO1_SPCSO3);
IedServer_setPerformCheckHandler(iedServer, IEDMODEL_GenericIO_GGIO1_DPCSO1,
(ControlPerformCheckHandler) performCheckHandler, IEDMODEL_GenericIO_GGIO1_DPCSO1);
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_DPCSO1, (ControlHandler) controlHandlerForBinaryOutput,
IEDMODEL_GenericIO_GGIO1_DPCSO1);
(ControlPerformCheckHandler)performCheckHandler, IEDMODEL_GenericIO_GGIO1_DPCSO1);
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_GGIO1_DPCSO1, (ControlHandler)controlHandlerForBinaryOutput,
IEDMODEL_GenericIO_GGIO1_DPCSO1);
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs, (ControlHandler) controlHandlerForInt32Controls,
IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs);
IedServer_setControlHandler(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs, (ControlHandler)controlHandlerForInt32Controls,
IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs);
/* Initialize process values */
MmsValue* DPCSO1_stVal = IedServer_getAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_DPCSO1_stVal);
MmsValue_setBitStringFromInteger(DPCSO1_stVal, 1); /* set DPC to OFF */
/* Initialize process values */
MmsValue *DPCSO1_stVal = IedServer_getAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_DPCSO1_stVal);
MmsValue_setBitStringFromInteger(DPCSO1_stVal, 1); /* set DPC to OFF */
/* Intitalize setting values */
IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpDlTmms_setVal, ledOffTimeMs);
IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_RsDlTmms_setVal, ledOnTimeMs);
/* Set callback handler for settings */
IedServer_handleWriteAccess(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpDlTmms_setVal, int32WriteAccessHandler, NULL);
IedServer_handleWriteAccess(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_RsDlTmms_setVal, int32WriteAccessHandler, NULL);
/* Intitalize setting values */
IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpDlTmms_setVal, ledOffTimeMs);
IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_RsDlTmms_setVal, ledOnTimeMs);
/* Set callback handler for settings */
IedServer_handleWriteAccess(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpDlTmms_setVal, int32WriteAccessHandler, NULL);
IedServer_handleWriteAccess(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_RsDlTmms_setVal, int32WriteAccessHandler, 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);
if (!IedServer_isRunning(iedServer))
{
printf("Starting server failed! Exit.\n");
IedServer_destroy(iedServer);
exit(-1);
}
float t = 0.f;
running = 1;
bool ledStateValue = false;
signal(SIGINT, sigint_handler);
uint64_t nextLedToggleTime = Hal_getTimeInMs() + 1000;
float t = 0.f;
while (running) {
uint64_t currentTime = Hal_getTimeInMs();
bool ledStateValue = false;
if (automaticOperationMode) {
if (nextLedToggleTime <= currentTime) {
uint64_t nextLedToggleTime = Hal_getTimeInMs() + 1000;
while (running)
{
uint64_t currentTime = Hal_getTimeInMs();
if (ledStateValue)
nextLedToggleTime = currentTime + ledOffTimeMs;
else
nextLedToggleTime = currentTime + ledOnTimeMs;
if (automaticOperationMode)
{
if (nextLedToggleTime <= currentTime)
{
if (ledStateValue)
nextLedToggleTime = currentTime + ledOffTimeMs;
else
nextLedToggleTime = currentTime + ledOnTimeMs;
ledStateValue = !ledStateValue;
ledStateValue = !ledStateValue;
if (ledStateValue) {
opCnt++;
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs_t, currentTime);
IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs_stVal, opCnt);
}
if (ledStateValue)
{
opCnt++;
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs_t, currentTime);
IedServer_updateInt32AttributeValue(iedServer, IEDMODEL_GenericIO_TIM_GAPC1_OpCntRs_stVal, opCnt);
}
updateLED1stVal(ledStateValue, currentTime);
updateLED2stVal(ledStateValue, currentTime);
updateLED3stVal(ledStateValue, currentTime);
}
}
updateLED1stVal(ledStateValue, currentTime);
updateLED2stVal(ledStateValue, currentTime);
updateLED3stVal(ledStateValue, currentTime);
}
}
t += 0.1f;
t += 0.1f;
IedServer_lockDataModel(iedServer);
IedServer_lockDataModel(iedServer);
IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn1_mag_f, sinf(t));
IedServer_updateQuality(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn1_q, QUALITY_VALIDITY_GOOD);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn1_t, currentTime);
IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn1_mag_f, sinf(t));
IedServer_updateQuality(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn1_q, QUALITY_VALIDITY_GOOD);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn1_t, currentTime);
IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn2_mag_f, sinf(t + 1.f));
IedServer_updateQuality(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn2_q, QUALITY_VALIDITY_GOOD);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn2_t, currentTime);
IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn2_mag_f, sinf(t + 1.f));
IedServer_updateQuality(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn2_q, QUALITY_VALIDITY_GOOD);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn2_t, currentTime);
IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn3_mag_f, sinf(t + 2.f));
IedServer_updateQuality(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn3_q, QUALITY_VALIDITY_GOOD);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn3_t, currentTime);
IedServer_updateQuality(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn3_q, QUALITY_VALIDITY_GOOD);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn3_t, currentTime);
IedServer_updateFloatAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn4_mag_f, sinf(t + 3.f));
IedServer_updateQuality(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn4_q, QUALITY_VALIDITY_GOOD);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn4_t, currentTime);
IedServer_updateQuality(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn4_q, QUALITY_VALIDITY_GOOD);
IedServer_updateUTCTimeAttributeValue(iedServer, IEDMODEL_GenericIO_GGIO1_AnIn4_t, currentTime);
IedServer_unlockDataModel(iedServer);
IedServer_unlockDataModel(iedServer);
Thread_sleep(100);
}
Thread_sleep(100);
}
/* stop MMS server - close TCP server socket and all client sockets */
IedServer_stop(iedServer);
/* stop MMS server - close TCP server socket and all client sockets */
IedServer_stop(iedServer);
/* Cleanup - free all resources */
IedServer_destroy(iedServer);
/* Cleanup - free all resources */
IedServer_destroy(iedServer);
} /* main() */

@ -6,9 +6,8 @@
#define BEAGLEBONE_LEDS_H_
/* set to 1 if you want to run the demo on a PC */
//#define SIMULATED
/* define SIMULATED if you want to run the demo on a PC */
#define SIMULATED
/* select correct file paths to access LEDs - depends on beaglebones linux distro/version */

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save