Please consider registering

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
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
Jouni Aro
Forum Posts: 914
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: 267

Currently Online:
9 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 111

pramanj: 86

ibrahim: 74

kapsl: 57

gjevremovic: 49

Xavier: 42

TimK: 41

fred: 41

Fransua33: 39

rocket science: 36

Member Stats:

Guest Posters: 0

Members: 1590

Moderators: 17

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1192

Posts: 5057

Newest Members:

warnerfleming, Raymond23Freex, Charles1UsadY, Robertvem, albertinaduff53, wilbertrignall, Rogerbeedo, letamunn4183992, Lizazooda, Hectorner

Moderators: Jouni Aro: 914, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 695, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 24, Teppo Uimonen: 21, Markus Johansson: 36, Niklas Nurminen: 0, Matti Siponen: 161, Lusetti: 0

Administrators: admin: 1