Avatar
Please consider registering
guest
sp_LogInOut Log Insp_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 RSSsp_TopicIcon
Need write Event on the OPC provier!
September 10, 2012
7:16, EEST
Avatar
gbird
Member
Members
Forum Posts: 5
Member Since:
September 4, 2012
sp_UserOfflineSmall Offline

Hi !
When then client write a value to “My.OPC” Server, how to know?
I don’t want “TPsVars.OnChange”, because I don’t know how determine it’s the sever self write or the client write.
From the client write to server, server must be write to PLC, have another solution.

Best regards

September 10, 2012
10:35, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1029
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

It is currently not possible to tell where the change is coming from.

In principle, you should write the “server changes” using SetPropValueAt, which “forces” the change into the variable. The “client writes” use PropValue-property. However, they both trigger OnChanging and OnChange, so you cannot tell which one was called at that point.

The only solution is to mark the variable, for example, using the Tag property before you are writing “server changes” and check the value of Tag in OnChanging or OnChange.

In OnChanging you can reject the change as well, in which case it will not be written to the variable at all. Except when SetPropValueAt is used, in which case the result of OnChanging is ignored.

Forum Timezone: Europe/Helsinki
Most Users Ever Online: 1919
Currently Online:
Guest(s) 33
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 90
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 732
Moderators: 8
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1545
Posts: 6516
Newest Members:
mood edibles, LouieWreve, daniellabdx, janessan21, sammiebeak359, gena7127517, thorstenbouldin, Brett.Rollason, steven014223542, Roberthat
Moderators: Jouni Aro: 1029, Pyry: 1, Petri: 1, Bjarne Boström: 1045, Jimmy Ni: 26, Matti Siponen: 353, Lusetti: 0, Elias: 0
Administrators: admin: 1