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: 1026
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: 1919

Currently Online:
16 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: 726

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_gallery

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1