12:14, EET
January 3, 2013
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
18:25, EET
December 21, 2011
These are also mapped from TPsFloat, to be exact as follows:
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;
7:18, EET
January 3, 2013
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;
9:59, EET
December 21, 2011
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)
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_galleryModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1