Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Run OPC in a Thread
June 16, 2012
6:49, EEST
Avatar
Rainer Versteeg
Member
Members
Forum Posts: 32
Member Since:
March 21, 2012
sp_UserOfflineSmall Offline

Hello !

Is it possible to create a OPCServer in A Thread ?

At the moment I initialize the OPC Server in the Inalization of a Class

initialization
coInitializeSecurity(NIL, -1, NIL, NIL, RPC_C_AUTHN_LEVEL_NONE,
RPC_C_IMP_LEVEL_IDENTIFY, NIL, EOAC_NONE, NIL);
OPCProvider := TPSOPCProvider.Create;
with OPCProvider do
begin
Autorun := true;
CLSID := ‘{4F3F0F22-36A7-4EBD-A717-D930B440F139}’;
Servername := ‘DEMiC_OPC_SERVER_V100’;
Description := ‘DEMiC OPC Server V1.00’;
Vendor := ‘DEMiC Datentechnik GmbH’;
VendorInfo := ”;
AddressSpace.IncludeProps := true;
Version := 0;
ThreadingModel := tmboth; // Default = tmBoth
ActivityLog.Active := false;
ActivityLog.MaxLines := 500;
ActivityLog.FileName := ‘Activity.log’;
OnItemAccessRights := cls_opcserver.OPCProviderItemAccessRights;
Initialize;
end;

Now i want call the above initalization in a Thread

procedure OPCThread.Execute;
begin
coInitializeex(nil, COINIT_MULTITHREADED);
While not terminated do
begin
//Inital OPC Server
end;
CoUninitialize;

Br,
Rainer

end;

June 18, 2012
7:53, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

No, the OPCProvider must be defined in the application initialization part.

It will use the standard COM server mechanisms of Delphi and actually uses internal threads to manage the incoming calls from clients.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
15 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 75

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 708

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1465

Posts: 6252

Newest Members:

christi10l, ahamad1, Flores Frederick, ellenmoss, harriettscherer, shanonhumphreys, KupimotoblokfuB, tamhollander5, paulinafcf, bridgette18l

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 982, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 319, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1