12:28, EEST
May 20, 2020
I use Sentrol673DC6Std for C++ Builder 6. I’ve tried to subscribe to the server items with this code below:
__fastcall Observer::Observer(const std::string &host, const std::string &serverId, int pollInterval, const
std::vector &items)
: TObject ()
, opcdaServer_ (new TPsOPCServer (0))
, group_ (new TPsOPCGroup (0))
{
opcdaServer_->Host = host.c_str ();
opcdaServer_->ServerName = AnsiString(serverId.c_str());
opcdaServer_->Log->Active = true;
opcdaServer_->Log->FileName = “file.log”;
opcdaServer_->Connect();
if (!opcdaServer_->Connected) {
std::cerr << "can’t connect" <Server = opcdaServer_;
group_->OnDataChange = onDataChanged;
group_->UpdateRate = 0;
group_->Async = true;
for (int i = 0; i AddItem (AnsiString(items[i].c_str()));
} catch (const Sysutils::Exception &e) {
std::cerr << e.Message.c_str() << std::endl;
}
}
}
}
void __fastcall Observer::onDataChanged (TObject *Sender, TPsOPCTransaction *tr)
{
std::cout << "here" << std::endl;
}
I see that I get into the onDataChanged, it is OK. But I also see that my application eats the memory from ~5 MB to 100 MB for one minute and continue to do it. What I do wrong?
Most Users Ever Online: 1919
Currently Online:
32 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 734
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1523
Posts: 6449
Newest Members:
christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley, Thomassnism, biancacraft16, edgardo3518Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1