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: 914
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: 914
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: 914
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

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

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

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