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

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

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
17 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 727

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_gallery

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1