338 lines
17 KiB
C++
338 lines
17 KiB
C++
![]() |
// SPDX-License-Identifier: MIT
|
||
|
/**
|
||
|
Copyright (c) 2015 - 2021 Beckhoff Automation GmbH & Co. KG
|
||
|
*/
|
||
|
|
||
|
#include "Log.h"
|
||
|
#include "AdsLib.h"
|
||
|
#include "AdsNotification.h"
|
||
|
#include "AdsVariable.h"
|
||
|
#include "TurbineData.h"
|
||
|
#include <array>
|
||
|
#include <cstring>
|
||
|
#include <iostream>
|
||
|
#include <iomanip>
|
||
|
#include <thread>
|
||
|
|
||
|
using namespace Beckhoff::Ads;
|
||
|
using ExampleDatatype = CGHAdsOverviewData;
|
||
|
#if 0
|
||
|
static void AdsNotifyCallback(const AmsAddr* pAddr, const AdsNotificationHeader* pNotification, uint32_t hUser)
|
||
|
{
|
||
|
ExampleDatatype data{};
|
||
|
std::memcpy(&data, pNotification + 1, std::min<size_t>(sizeof(data), pNotification->cbSampleSize));
|
||
|
std::cout << std::setfill('0') <<
|
||
|
" NetId: " << pAddr->netId <<
|
||
|
" hUser 0x" << std::hex << hUser <<
|
||
|
" sample time: " << std::dec << pNotification->nTimeStamp <<
|
||
|
" sample size: " << std::dec << pNotification->cbSampleSize <<
|
||
|
" value:" << data.fWindSpeed << "\n";
|
||
|
}
|
||
|
|
||
|
static void notificationExample(std::ostream& out, const AdsDevice& route)
|
||
|
{
|
||
|
const AdsNotificationAttrib attrib = {
|
||
|
sizeof(ExampleDatatype),
|
||
|
Beckhoff::Ads::ADSTRANS_SERVERCYCLE,
|
||
|
0,
|
||
|
{10000000}
|
||
|
};
|
||
|
AdsNotification notification {route, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr, attrib, &AdsNotifyCallback, 0xDEADBEEF};
|
||
|
|
||
|
out << "Hit ENTER to stop notifications\n";
|
||
|
std::cin.ignore();
|
||
|
}
|
||
|
|
||
|
static void notificationByNameExample(std::ostream& out, const AdsDevice& route)
|
||
|
{
|
||
|
const AdsNotificationAttrib attrib = {
|
||
|
sizeof(ExampleDatatype),
|
||
|
Beckhoff::Ads::ADSTRANS_SERVERCYCLE,
|
||
|
0,
|
||
|
{4000000}
|
||
|
};
|
||
|
|
||
|
out << __FUNCTION__ << "():\n";
|
||
|
AdsNotification notification { route, "MAIN.byByte[4]", attrib, &AdsNotifyCallback, 0xBEEFDEAD };
|
||
|
|
||
|
out << "Hit ENTER to stop by name notifications\n";
|
||
|
std::cin.ignore();
|
||
|
}
|
||
|
|
||
|
static void readExample(std::ostream& out, const AdsDevice& route)
|
||
|
{
|
||
|
AdsVariable<ExampleDatatype> readVar {route, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr};
|
||
|
ExampleDatatype var;
|
||
|
|
||
|
while (true){
|
||
|
var = (ExampleDatatype)readVar;
|
||
|
LOG_INFO("OperationMode " << var.iTurbineOperationMode << ".");
|
||
|
LOG_INFO("iBPLevel " << var.iBPLevel << ".");
|
||
|
LOG_INFO("iYPLevel " << var.iYPLevel << ".");
|
||
|
LOG_INFO("bYawCCWStart " << std::hex << var.bYawCCWStart);
|
||
|
LOG_INFO("bYawCWStart " << std::hex << var.bYawCWStart);
|
||
|
LOG_INFO("bTowerDoorOpen " << std::hex << var.bTowerDoorOpen);
|
||
|
|
||
|
LOG_INFO("GenPower " << var.fGenPower << "kW");
|
||
|
LOG_INFO("GenSpeed " << var.fGenSpeed << "rpm");
|
||
|
LOG_INFO("OpHours " << var.iOperationHoursTotal << "h");
|
||
|
LOG_INFO("FaultInfo " << var.dwFaultInformation << ".");
|
||
|
LOG_INFO("EnergyProducedTotal " << var.fEnergyProducedTotal << ".");
|
||
|
LOG_INFO("EnergyProducedToday " << var.fEnergyProducedToday << ".");
|
||
|
LOG_INFO("<<===========================Next Line===================================>>");
|
||
|
|
||
|
usleep(1000*1000);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
static void readByNameExample(std::ostream& out, const AdsDevice& route)
|
||
|
{
|
||
|
AdsVariable<uint16_t> readVar {route, ".gstRemCOM_Rx_Overview.iTurbineOperationMode"};
|
||
|
|
||
|
//out << __FUNCTION__ << "():\n";
|
||
|
//for (size_t i = 0; i < 8; ++i) {
|
||
|
LOG_INFO("OperationMode " << readVar << ".");
|
||
|
usleep(1000*1000);
|
||
|
//}
|
||
|
}
|
||
|
|
||
|
static void readWriteExample(std::ostream& out, const AdsDevice& route)
|
||
|
{
|
||
|
AdsVariable<uint8_t> simpleVar {route, "MAIN.byByte[0]"};
|
||
|
AdsVariable<uint8_t> validation {route, "MAIN.byByte[0]"};
|
||
|
|
||
|
out << __FUNCTION__ << "():\n";
|
||
|
simpleVar = 0xA5;
|
||
|
out << "Wrote " << 0xA5 << " to MAIN.byByte and read " << (uint32_t)validation << " back\n";
|
||
|
simpleVar = 0x5A;
|
||
|
out << "Wrote " << (uint32_t)simpleVar << " to MAIN.byByte and read " << (uint32_t)validation << " back\n";
|
||
|
}
|
||
|
|
||
|
static void readWriteArrayExample(std::ostream& out, const AdsDevice& route)
|
||
|
{
|
||
|
static const std::array<uint8_t, 4> arrayToWrite = { 1, 2, 3, 4 };
|
||
|
AdsVariable<std::array<uint8_t, 4> > arrayVar {route, "MAIN.byByte"};
|
||
|
arrayVar = arrayToWrite;
|
||
|
std::array<uint8_t, 4> readArray = arrayVar;
|
||
|
out << "Wrote array with first value " << (uint32_t)arrayToWrite[0] << " and last value " <<
|
||
|
(uint32_t)arrayToWrite[3] << "\n";
|
||
|
out << "Read back array with first value " << (uint32_t)readArray[0] << " and last value " <<
|
||
|
(uint32_t)readArray[3] << "\n";
|
||
|
}
|
||
|
#endif
|
||
|
static void readStateExample(const AdsDevice& route)
|
||
|
{
|
||
|
const auto state = route.GetState();
|
||
|
std::cout << "ADS state: " << std::dec << (uint16_t)state.ads << " devState: " << std::dec << (uint16_t)state.device << std::endl;
|
||
|
}
|
||
|
|
||
|
static void runExample(std::ostream& out)
|
||
|
{
|
||
|
// uncomment and adjust if automatic AmsNetId deduction is not working as expected
|
||
|
SetLocalAmsNetId({192, 168, 129, 25, 1, 1});
|
||
|
|
||
|
//
|
||
|
static const AmsNetId remoteNetId_26 { 192, 168, 129, 26, 1, 1 };
|
||
|
static const char remoteIp_26[] = "192.168.129.26";
|
||
|
// static const AmsNetId remoteNetId_28 { 192, 168, 129, 28, 1, 1 };
|
||
|
// static const char remoteIp_28[] = "192.168.129.28";
|
||
|
// static const AmsNetId remoteNetId_34 { 192, 168, 129, 34, 1, 1 };
|
||
|
// static const char remoteIp_34[] = "192.168.129.34";
|
||
|
// static const AmsNetId remoteNetId_35 { 192, 168, 129, 35, 1, 1 };
|
||
|
// static const char remoteIp_35[] = "192.168.129.35";
|
||
|
// static const AmsNetId remoteNetId_36 { 192, 168, 129, 36, 1, 1 };
|
||
|
// static const char remoteIp_36[] = "192.168.129.36";
|
||
|
// static const AmsNetId remoteNetId_37 { 192, 168, 129, 37, 1, 1 };
|
||
|
// static const char remoteIp_37[] = "192.168.129.37";
|
||
|
// static const AmsNetId remoteNetId_38 { 192, 168, 129, 38, 1, 1 };
|
||
|
// static const char remoteIp_38[] = "192.168.129.38";
|
||
|
|
||
|
AdsDevice turbine_26 {remoteIp_26, remoteNetId_26, AMSPORT_R0_PLC_RTS1};
|
||
|
// AdsDevice turbine_26_1 {remoteIp_26, remoteNetId_26, AMSPORT_R0_PLC_RTS2};
|
||
|
// AdsDevice turbine_26_2 {remoteIp_26, remoteNetId_26, AMSPORT_R0_PLC_RTS3};
|
||
|
// AdsDevice turbine_26_3 {remoteIp_26, remoteNetId_26, AMSPORT_R0_PLC_RTS4};
|
||
|
/*AdsDevice turbine_28 {remoteIp_28, remoteNetId_28, AMSPORT_R0_PLC_RTS1};
|
||
|
AdsDevice turbine_34 {remoteIp_34, remoteNetId_34, AMSPORT_R0_PLC_RTS1};
|
||
|
AdsDevice turbine_35 {remoteIp_35, remoteNetId_35, AMSPORT_R0_PLC_RTS1};
|
||
|
AdsDevice turbine_36 {remoteIp_36, remoteNetId_36, AMSPORT_R0_PLC_RTS1};
|
||
|
AdsDevice turbine_37 {remoteIp_37, remoteNetId_37, AMSPORT_R0_PLC_RTS1};
|
||
|
AdsDevice turbine_38 {remoteIp_38, remoteNetId_38, AMSPORT_R0_PLC_RTS1};*/
|
||
|
|
||
|
AdsVariable<CGHAdsOverviewData> turbineData_26 {turbine_26, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr};
|
||
|
AdsVariable<std::array<uint8_t, 500>> turbineData_26_1 {turbine_26, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr};
|
||
|
// AdsVariable<CGHAdsTempData> turbineTempData_26 {turbine_26, ADSIGRP_IOIMAGE_RWOB, AdsTempDataMemAddr};
|
||
|
// AdsVariable<CGHAdsOverviewData> turbineData_26_1 {turbine_26_1, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr};
|
||
|
// AdsVariable<CGHAdsTempData> turbineTempData_26_1 {turbine_26_1, ADSIGRP_IOIMAGE_RWOB, AdsTempDataMemAddr};
|
||
|
// AdsVariable<CGHAdsOverviewData> turbineData_26_2 {turbine_26_2, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr};
|
||
|
// AdsVariable<CGHAdsTempData> turbineTempData_26_2 {turbine_26_2, ADSIGRP_IOIMAGE_RWOB, AdsTempDataMemAddr};
|
||
|
// AdsVariable<CGHAdsOverviewData> turbineData_26_3 {turbine_26_3, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr};
|
||
|
// AdsVariable<CGHAdsTempData> turbineTempData_26_3 {turbine_26_3, ADSIGRP_IOIMAGE_RWOB, AdsTempDataMemAddr};
|
||
|
/*AdsVariable<CGHAdsOverviewData> turbineData_28 {turbine_28, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr};
|
||
|
AdsVariable<CGHAdsOverviewData> turbineData_34 {turbine_34, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr};
|
||
|
AdsVariable<CGHAdsOverviewData> turbineData_35 {turbine_35, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr};
|
||
|
AdsVariable<CGHAdsOverviewData> turbineData_36 {turbine_36, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr};
|
||
|
AdsVariable<CGHAdsOverviewData> turbineData_37 {turbine_37, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr};
|
||
|
AdsVariable<CGHAdsOverviewData> turbineData_38 {turbine_38, ADSIGRP_IOIMAGE_RWOB, AdsOverviewDataMemAddr};*/
|
||
|
|
||
|
CGHAdsOverviewData var;
|
||
|
// CGHAdsTempData tempVar;
|
||
|
fprintf(stderr, "len is: %d\n", sizeof(CGHAdsOverviewData));
|
||
|
uint8_t buffer[1024];
|
||
|
uint8_t *pData = buffer;
|
||
|
LOG_INFO("<<===========================Starting===================================>>");
|
||
|
while (true)
|
||
|
{
|
||
|
fprintf(stderr, "pData is: %lu\n", pData);
|
||
|
pData = ((std::array<uint8_t, 500>)turbineData_26_1).data();
|
||
|
fprintf(stderr, "pData is: %lu\n", pData);
|
||
|
LOG_INFO("OperationMode " << *(uint16_t *)pData << "."); pData += 2;
|
||
|
LOG_INFO("iBPLevel " << *(uint16_t *)pData); pData += 2;
|
||
|
LOG_INFO("iYPLevel " << *(uint16_t *)pData); pData += 2;
|
||
|
LOG_INFO("bYawCCWStart " << (pData[0] > 0) ); pData++;
|
||
|
LOG_INFO("bYawCWStart " << (pData[0] > 0) ); pData++;
|
||
|
LOG_INFO("bTowerDoorOpen " << (pData[0] > 0) ); pData++;
|
||
|
LOG_INFO("GenPower " << *(float *)pData << "kW"); pData += 4;
|
||
|
LOG_INFO("GenSpeed " << *(float *)pData << "rpm"); pData += 4;
|
||
|
LOG_INFO("WindSpeed " << *(float *)pData << "m/s"); pData += 4;
|
||
|
LOG_INFO("OpHours " << *(float *)pData << "h"); pData += 4;
|
||
|
|
||
|
var = (CGHAdsOverviewData)turbineData_26;
|
||
|
LOG_INFO("<<===========================Port 801===================================>>");
|
||
|
LOG_INFO("OperationMode " << var.iTurbineOperationMode << ".");
|
||
|
LOG_INFO("iBPLevel " << var.iBPLevel);
|
||
|
LOG_INFO("iYPLevel " << var.iYPLevel);
|
||
|
LOG_INFO("bYawCCWStart " << (var.bYawCCWStart > 0) );
|
||
|
LOG_INFO("bYawCWStart " << (var.bYawCWStart > 0) );
|
||
|
LOG_INFO("bTowerDoorOpen " << (var.bTowerDoorOpen > 0) );
|
||
|
LOG_INFO("GenPower " << var.fGenPower1s << "kW");
|
||
|
LOG_INFO("GenSpeed " << var.fGenSpeed1s << "rpm");
|
||
|
LOG_INFO("WindSpeed " << var.fWindSpeed1s << "m/s");
|
||
|
LOG_INFO("OpHours " << var.iOperationHoursTotal << "h");
|
||
|
LOG_INFO("FaultInfo " << var.dwFaultInformation);
|
||
|
LOG_INFO("EnergyProducedTotal " << var.fEnergyProducedTotal << " kWh");
|
||
|
LOG_INFO("EnergyProducedToday " << var.fEnergyProducedToday << " kWh");
|
||
|
LOG_INFO("<<===========================Next Line===================================>>");
|
||
|
#if 0
|
||
|
tempVar = (CGHAdsTempData)turbineTempData_26;
|
||
|
LOG_INFO("EnvTemp " << tempVar.fEnvTemp1s);
|
||
|
LOG_INFO("HubTemp " << tempVar.fHubTemp1s);
|
||
|
LOG_INFO("NacelleTemp " << tempVar.fNacelleTemp1s);
|
||
|
LOG_INFO("TowerBaseTemp " << tempVar.fTowerBaseTemp1s);
|
||
|
LOG_INFO("GenCoolAirTemp " << tempVar.fGenCoolAirTemp1s);
|
||
|
LOG_INFO("GearDEBearTemp " << tempVar.fGearDEBearTemp1s);
|
||
|
LOG_INFO("GenDEBearTemp " << tempVar.fGenDEBearTemp1s);
|
||
|
LOG_INFO("GenWindUTemp " << tempVar.fGenWindUTemp1s);
|
||
|
LOG_INFO("<<===========================Next Line===================================>>");
|
||
|
|
||
|
var = (CGHAdsOverviewData)turbineData_26_1;
|
||
|
LOG_INFO("<<===========================Port 811===================================>>");
|
||
|
LOG_INFO("OperationMode " << var.iTurbineOperationMode << ".");
|
||
|
LOG_INFO("iBPLevel " << var.iBPLevel);
|
||
|
LOG_INFO("iYPLevel " << var.iYPLevel);
|
||
|
LOG_INFO("bYawCCWStart " << (var.bYawCCWStart > 0) );
|
||
|
LOG_INFO("bYawCWStart " << (var.bYawCWStart > 0) );
|
||
|
LOG_INFO("bTowerDoorOpen " << (var.bTowerDoorOpen > 0) );
|
||
|
LOG_INFO("GenPower " << var.fGenPower1s << "kW");
|
||
|
LOG_INFO("GenSpeed " << var.fGenSpeed1s << "rpm");
|
||
|
LOG_INFO("WindSpeed " << var.fWindSpeed1s << "m/s");
|
||
|
LOG_INFO("OpHours " << var.iOperationHoursTotal << "h");
|
||
|
LOG_INFO("FaultInfo " << var.dwFaultInformation);
|
||
|
LOG_INFO("EnergyProducedTotal " << var.fEnergyProducedTotal << " kWh");
|
||
|
LOG_INFO("EnergyProducedToday " << var.fEnergyProducedToday << " kWh");
|
||
|
LOG_INFO("<<===========================Next Line===================================>>");
|
||
|
|
||
|
tempVar = (CGHAdsTempData)turbineTempData_26_1;
|
||
|
LOG_INFO("EnvTemp " << tempVar.fEnvTemp1s);
|
||
|
LOG_INFO("HubTemp " << tempVar.fHubTemp1s);
|
||
|
LOG_INFO("NacelleTemp " << tempVar.fNacelleTemp1s);
|
||
|
LOG_INFO("TowerBaseTemp " << tempVar.fTowerBaseTemp1s);
|
||
|
LOG_INFO("GenCoolAirTemp " << tempVar.fGenCoolAirTemp1s);
|
||
|
LOG_INFO("GearDEBearTemp " << tempVar.fGearDEBearTemp1s);
|
||
|
LOG_INFO("GenDEBearTemp " << tempVar.fGenDEBearTemp1s);
|
||
|
LOG_INFO("GenWindUTemp " << tempVar.fGenWindUTemp1s);
|
||
|
LOG_INFO("<<===========================Next Line===================================>>");
|
||
|
|
||
|
var = (CGHAdsOverviewData)turbineData_26_2;
|
||
|
LOG_INFO("<<===========================Port 821===================================>>");
|
||
|
LOG_INFO("OperationMode " << var.iTurbineOperationMode << ".");
|
||
|
LOG_INFO("iBPLevel " << var.iBPLevel);
|
||
|
LOG_INFO("iYPLevel " << var.iYPLevel);
|
||
|
LOG_INFO("bYawCCWStart " << (var.bYawCCWStart > 0) );
|
||
|
LOG_INFO("bYawCWStart " << (var.bYawCWStart > 0) );
|
||
|
LOG_INFO("bTowerDoorOpen " << (var.bTowerDoorOpen > 0) );
|
||
|
LOG_INFO("GenPower " << var.fGenPower1s << "kW");
|
||
|
LOG_INFO("GenSpeed " << var.fGenSpeed1s << "rpm");
|
||
|
LOG_INFO("WindSpeed " << var.fWindSpeed1s << "m/s");
|
||
|
LOG_INFO("OpHours " << var.iOperationHoursTotal << "h");
|
||
|
LOG_INFO("FaultInfo " << var.dwFaultInformation);
|
||
|
LOG_INFO("EnergyProducedTotal " << var.fEnergyProducedTotal << " kWh");
|
||
|
LOG_INFO("EnergyProducedToday " << var.fEnergyProducedToday << " kWh");
|
||
|
LOG_INFO("<<===========================Next Line===================================>>");
|
||
|
|
||
|
tempVar = (CGHAdsTempData)turbineTempData_26_2;
|
||
|
LOG_INFO("EnvTemp " << tempVar.fEnvTemp1s);
|
||
|
LOG_INFO("HubTemp " << tempVar.fHubTemp1s);
|
||
|
LOG_INFO("NacelleTemp " << tempVar.fNacelleTemp1s);
|
||
|
LOG_INFO("TowerBaseTemp " << tempVar.fTowerBaseTemp1s);
|
||
|
LOG_INFO("GenCoolAirTemp " << tempVar.fGenCoolAirTemp1s);
|
||
|
LOG_INFO("GearDEBearTemp " << tempVar.fGearDEBearTemp1s);
|
||
|
LOG_INFO("GenDEBearTemp " << tempVar.fGenDEBearTemp1s);
|
||
|
LOG_INFO("GenWindUTemp " << tempVar.fGenWindUTemp1s);
|
||
|
LOG_INFO("<<===========================Next Line===================================>>");
|
||
|
|
||
|
var = (CGHAdsOverviewData)turbineData_26_3;
|
||
|
LOG_INFO("<<===========================Port 831===================================>>");
|
||
|
LOG_INFO("OperationMode " << var.iTurbineOperationMode << ".");
|
||
|
LOG_INFO("iBPLevel " << var.iBPLevel);
|
||
|
LOG_INFO("iYPLevel " << var.iYPLevel);
|
||
|
LOG_INFO("bYawCCWStart " << (var.bYawCCWStart > 0) );
|
||
|
LOG_INFO("bYawCWStart " << (var.bYawCWStart > 0) );
|
||
|
LOG_INFO("bTowerDoorOpen " << (var.bTowerDoorOpen > 0) );
|
||
|
LOG_INFO("GenPower " << var.fGenPower1s << "kW");
|
||
|
LOG_INFO("GenSpeed " << var.fGenSpeed1s << "rpm");
|
||
|
LOG_INFO("WindSpeed " << var.fWindSpeed1s << "m/s");
|
||
|
LOG_INFO("OpHours " << var.iOperationHoursTotal << "h");
|
||
|
LOG_INFO("FaultInfo " << var.dwFaultInformation);
|
||
|
LOG_INFO("EnergyProducedTotal " << var.fEnergyProducedTotal << " kWh");
|
||
|
LOG_INFO("EnergyProducedToday " << var.fEnergyProducedToday << " kWh");
|
||
|
LOG_INFO("<<===========================Next Line===================================>>");
|
||
|
|
||
|
tempVar = (CGHAdsTempData)turbineTempData_26_3;
|
||
|
LOG_INFO("EnvTemp " << tempVar.fEnvTemp1s);
|
||
|
LOG_INFO("HubTemp " << tempVar.fHubTemp1s);
|
||
|
LOG_INFO("NacelleTemp " << tempVar.fNacelleTemp1s);
|
||
|
LOG_INFO("TowerBaseTemp " << tempVar.fTowerBaseTemp1s);
|
||
|
LOG_INFO("GenCoolAirTemp " << tempVar.fGenCoolAirTemp1s);
|
||
|
LOG_INFO("GearDEBearTemp " << tempVar.fGearDEBearTemp1s);
|
||
|
LOG_INFO("GenDEBearTemp " << tempVar.fGenDEBearTemp1s);
|
||
|
LOG_INFO("GenWindUTemp " << tempVar.fGenWindUTemp1s);
|
||
|
LOG_INFO("<<===========================Next Line===================================>>");
|
||
|
#endif
|
||
|
usleep(1000*1000);
|
||
|
readStateExample(turbine_26);
|
||
|
}
|
||
|
|
||
|
//notificationExample(out, turbine);
|
||
|
//notificationByNameExample(out, turbine);
|
||
|
//readExample(out, turbine);
|
||
|
//readByNameExample(out, turbine);
|
||
|
//readWriteExample(out, turbine);
|
||
|
//readWriteArrayExample(out, turbine);
|
||
|
//readStateExample(out, turbine);
|
||
|
}
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
try {
|
||
|
//LOG_INFO("Main thread is 0x"<<std::hex<<std::this_thread::get_id());
|
||
|
runExample(std::cout);
|
||
|
} catch (const AdsException& ex) {
|
||
|
std::cout << "Error: " << ex.errorCode << "\n";
|
||
|
std::cout << "AdsException message: " << ex.what() << "\n";
|
||
|
} catch (const std::runtime_error& ex) {
|
||
|
std::cout << ex.what() << '\n';
|
||
|
}
|
||
|
std::cout << "Hit ENTER to continue\n";
|
||
|
std::cin.ignore();
|
||
|
}
|