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
Add new item by code
January 6, 2015
17:33, EET
Avatar
gkobler
Member
Members
Forum Posts: 15
Member Since:
January 6, 2015
sp_UserOfflineSmall Offline

Hello

How can i create an new item, that is requested from a OPC-Client. Is there a event that are triggered?

My idea are, the client give me the item-name, and my OPC-Server should add the new item with this name!

For an Exampel:
the OPC-Client are requesting the follow OPC-Item: “KSA.DB200.DBW0”
Now the OPC-Server should add this to the variable list

May somebody can give me a hint!

Thanks
Gregor

January 8, 2015
9:26, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

You can use TPsOPCProvider.OnFindItem event for that.

If an item already exists, it is provided as Component for the event handler. If it is nil, you can create a new item and return that one back as Component.

January 8, 2015
12:37, EET
Avatar
gkobler
Member
Members
Forum Posts: 15
Member Since:
January 6, 2015
sp_UserOfflineSmall Offline

Jouni Aro said

You can use TPsOPCProvider.OnFindItem event for that.

If an item already exists, it is provided as Component for the event handler. If it is nil, you can create a new item and return that one back as Component.

Hello Jouni

Thanks for your answer, thats exactly what i need!

Gregor

January 8, 2015
13:20, EET
Avatar
gkobler
Member
Members
Forum Posts: 15
Member Since:
January 6, 2015
sp_UserOfflineSmall Offline

Hello Juoni

How can i create a OPC-Item, that are has the datatyp SmallInt

When i use TPsInteger, it will create a “Long Integer” at the client side.

And i also want to create a Array of SmallInt. There is a Object called TPsByteArray, but this will create not that what i want!

Thanks
Gregor

January 8, 2015
14:21, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

gkobler said
How can i create a OPC-Item, that are has the datatyp SmallInt

When i use TPsInteger, it will create a “Long Integer” at the client side.

And i also want to create a Array of SmallInt. There is a Object called TPsByteArray, but this will create not that what i want!

Prosys Central only uses “major” data types in the variables, so it is not possible to create SmallInt items. There is no real requirement to save memory with alternative data types. The client can, however, request data as SmallInt (using OPC Item DataType/RequestedDataType) and the OPCProvider will do the required conversions. I am not sure how the arrays will convert, though.

January 12, 2015
8:09, EET
Avatar
gkobler
Member
Members
Forum Posts: 15
Member Since:
January 6, 2015
sp_UserOfflineSmall Offline

Jouni Aro said

gkobler said
How can i create a OPC-Item, that are has the datatyp SmallInt

When i use TPsInteger, it will create a “Long Integer” at the client side.

And i also want to create a Array of SmallInt. There is a Object called TPsByteArray, but this will create not that what i want!

Prosys Central only uses “major” data types in the variables, so it is not possible to create SmallInt items. There is no real requirement to save memory with alternative data types. The client can, however, request data as SmallInt (using OPC Item DataType/RequestedDataType) and the OPCProvider will do the required conversions. I am not sure how the arrays will convert, though.

Hello Jouni

Thanks for it, i think i got what i want. It’s not in matter to save space. But the Siemens-OPC-Server makes thes Datatypes, when he creates his OPC-Items.

I have made a heredity of the type TPsInteger and changed the datatype to SmallInt, and i did it also with TPsByteArray.

Regards
Gregor

January 12, 2015
9:55, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1026
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

OK, yes I did not pay attention to the “client side”. But note that Sentrol will convert data types automatically, as it normally does not matter that much any more on the client application what the original data type was. I think TPsFloatArray should also work with SmallInt arrays.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

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