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
TagPropertys OPC server
January 3, 2013
12:14, EEST
Avatar
Fjonson
Member
Members
Forum Posts: 9
Member Since:
January 3, 2013
sp_UserOfflineSmall Offline

Hello.

I have one question.
Testing out this fabulous components butt there one thing i don’t understand.
I want to publish property 100 OPC_PROP_UNIT to 105 OPC_PROP_LORANGE how do i do it.

The information needed for property 100,101,102,103,104,105 is available in the TpsFloat object.
But then I connect with a client only property 1,2,3,4,5,6 is available.
To make my server useful is need to publish 100,101,102,103,104,105.

/Fjonson

January 3, 2013
18:25, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 853
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

These are also mapped from TPsFloat, to be exact as follows:

OPC_PROP_UNIT:
Prop := vpEngUnit;
OPC_PROP_DESC:
Prop := vpCaption;
OPC_PROP_HIEU:
if Variable is TPsCustomFloat then
Result := TPsCustomFloat(Variable).RangeMax
else if Variable is TPsInteger then
Result := TPsInteger(Variable).RangeMax
else if Variable is TPsCustomState then
begin
S := TPsState(Variable);
if S.States.Count > 0 then
Result := S.States[S.States.Count-1].Name
else
Result := Unassigned;
end
else
UnsupportedPropertyError(PropertyID);
OPC_PROP_LOEU:
if Variable is TPsCustomFloat then
Result := TPsCustomFloat(Variable).RangeMin
else if Variable is TPsInteger then
Result := TPsInteger(Variable).RangeMin
else if Variable is TPsCustomState then
begin
S := TPsState(Variable);
if S.States.Count > 0 then
Result := S.States[0].Name
else
Result := Unassigned;
end
else
UnsupportedPropertyError(PropertyID);
OPC_PROP_HIRANGE:
Result := (Variable as TPsCustomFloat).RangeMax;
OPC_PROP_LORANGE:
Result := (Variable as TPsCustomFloat).RangeMin;
January 4, 2013
7:18, EEST
Avatar
Fjonson
Member
Members
Forum Posts: 9
Member Since:
January 3, 2013
sp_UserOfflineSmall Offline

Hello.

Thanks for the answer. But i still don’t under stand why property 100-105 not is published by the opc server.
This is part of the code, do i miss something. Then i run the server everything works great but if I inspect Item properties from a opc client i only see prop 1 to 6

/fjonson

MRSOPCServer.OnConnect:=OPCConnect;
MRSOPCServer.OnDisconnect:=OPCDisconnect;
MRSOPCServer.AddressSpace.AutoAddApplication := False;
MRSOPCServer.AddressSpace.PathSeparator := ‘/’;
MRSOPCServer.AddressSpace.IncludeProps := False;
RootIndex := MRSOPCServer.AddressSpace.AddModule(Self, -1, ‘MRS’);
AnalogIn := MRSOPCServer.AddressSpace.AddModule(Self,RootIndex,’In_Signal’);
SQLQuery1.Close;
SQLQuery1.SQL.Clear;
SQLQuery1.SQL.Add(‘Select s.Tag,”In_Signal”,Outscale_low,Outscale_hi,Name,Unit,Description from tbl_signal s left join tbl_names n on s.tag=n.tag where Not(name is null)’);
SQLQuery1.Open;
While Not SQLQuery1.Eof do begin
TmpTag:=TPsFloat.Create(nil);
TPsFloat(TmpTag).SetRange(SQLQuery1.FieldByName(‘Outscale_low’).AsFloat,SQLQuery1.FieldByName(‘Outscale_hi’).AsFloat);
TPsFloat(TmpTag).EngUnit:=SQLQuery1.FieldByName(‘Unit’).AsString;
TPsFloat(TmpTag).Description:=SQLQuery1.FieldByName(‘Description’).AsString;
TPsFloat(TmpTag).Tag:=SQLQuery1.FieldByName(‘Tag’).AsString;
MRSOPCServer.AddressSpace.AddVariable(AnalogIn,TmpTag,SQLQuery1.FieldByName(‘Name’).AsString);
SQLQuery1.Next;
end;
SQLQuery1.Close;

January 4, 2013
9:59, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 853
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

You are right. The server was not exposing these properties as available. If you send an email to sentrol-support@prosysopc.com, I will provide you an update (mention also which Delphi version you are using)

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online:
15 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 103

pramanj: 86

ibrahim: 70

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 38

Rainer Versteeg: 32

Thomas Reuther: 31

Member Stats:

Guest Posters: 0

Members: 1118

Moderators: 14

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1034

Posts: 4352

Newest Members:

aldayr, Python techie, emanuel45q, Patrick, sammycontrols, hellema, linoy, subranna, ray, richN9177

Moderators: Jouni Aro: 853, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 559, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 21, Markus Johansson: 24, Matti Siponen: 64, Lusetti: 0

Administrators: admin: 1