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, EET
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, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
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, EET
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, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
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: 518

Currently Online:
20 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 679

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores Frederick

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

Administrators: admin: 1