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

Currently Online:
11 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