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
Problem reading a tag
September 14, 2015
14:19, EEST
Avatar
Fransua33
Member
Members
Forum Posts: 39
Member Since:
October 27, 2014
sp_UserOfflineSmall Offline

Imagine that you have an OPC server (SRV1) with a boolean tag and two clients reading this tag in async mode (CL1 and CL2).

CL1 use the value of the tag (using the OnChange event) to set a string tag of another OPC server (Prosys Provider – SRV2).

The CL2 have the tag in SRV1 and the one in SRV2 configured with the Onchange event for both. Lot of times the CL2 client reachs the event of the tag in SRV2 (which depends on the change of the value of the tag in SRV1) before the event of the tag in SRV2.

The question is clear: why? because the logic says that if to change the tag in SRV2 you need that the tag in SRV1 change, you always detect first the change of SRV1 tag and after the change of SRV2 tag. But the reality doesn’t seem to be this way

The problem is that, in CL2, I have the string tag changed and if I try to evaluate the value of the SRV1 tag I read an incorrect value because the tag value hasn’t change yet.

Attempting to avoid this behavior, I try to force the SRV2 connector to refresh the values (Refresh) in the CL2 when the string tag change. I have the same problem and I don’t know why. Is the Refresh function really force the client to read the server’s tags ? Is there a type of read cache ?

September 16, 2015
9:17, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Yes, I believe this may be complicated to get synchronized.

If the clients are asynchronous (TPsOPCConnector.Async = True), then Refresh() will make an asynchronous refresh call to the server. Otherwise, it will make a synchronous read call to the server. You can use TPsOPCConnector.OPCGroup.SyncRefresh() to make a synchronous read even when the client is in async mode.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
26 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 680

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6260

Newest Members:

sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule

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