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:
17 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 86
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 732
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1508
Posts: 6396
Newest Members:
elainesever, powhephenry, mamiecaldwell5, Lamasom, scsneed, berrybulcock, icerdraizomma, athenasummy5, vtaletbhcx, HaroldaDobModerators: Jouni Aro: 1019, Pyry: 1, Petri: 0, Bjarne Boström: 1016, Jimmy Ni: 26, Matti Siponen: 340, Lusetti: 0
Administrators: admin: 1