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
How to disable an OPC tag in a Provider
August 31, 2015
8:39, EEST
Avatar
Fransua33
Member
Members
Forum Posts: 39
Member Since:
October 27, 2014
sp_UserOfflineSmall Offline

We try to disable an OPC tag in our provider to check properties changes in the client. But we don’t be sure how to accomplish the task. We see several options but we are not sure wich is the best one:

1.- Eliminate the tag in the address space. We think that is a bit rough to just disable a tag.
2.- Free the TPsVar used for this tag. Same as point 1
3.- Declare all the properties as undifined with the Undefine() methos of TPsVar class. Don’t sure that doing this actions made the tag disable
4.- Use the Active property of the TPsVar. Same as point 3

Wich one is the best or is there another way to achieve our goal?

To be sure that we are in the same idea in mind: we want to disable a tag (value to NULL, quality to BAD, …) but we want the tag to stay in the tag list of the provider.

August 31, 2015
9:43, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Undefine() sets the quality to BAD – and the Value is then always NULL. But the client applications may still change the value. You can set the Variable to ReadOnly to prevent changes from client applications.

September 1, 2015
9:53, EEST
Avatar
Fransua33
Member
Members
Forum Posts: 39
Member Since:
October 27, 2014
sp_UserOfflineSmall Offline

I used it and effectively the tag gone in a Bd quality state.

I add code into the OnChange event in the client app to test if the quality is good (IsGood test). If it’s not good I put a message int a memo.

So with that I deactivate my tag in the provider. The value refresh in the client stops (that what I expect) but the code in the OnChange isn’t executed.

I’m working with the async mode enabled.

void __fastcall TFMain::TestTagChange(TPsVar *Sender, TPsVarPropTypes props) {
if (!this->testTag->IsGood) {
this->MmMessages->Lines->Add(“PROBLEM READING TAG””);
}
}

I think that the steps are correct but the message never appears in the memo.

September 3, 2015
8:07, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Good. I don’t know, though why you never get the change event for bad quality. It should be called whenever the value or quality changes.

September 3, 2015
8:08, EEST
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Try changing ‘this->testTag’ to ‘Sender’

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
20 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 685

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores Frederick, ellenmoss

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