Page 1 of 1

Make tag read-only for specific controller

Posted: Thu Jan 03, 2013 8:03 am
by AMitchneck
Does iX have the ability to make a tag read-only to a specific controller?

I have a project that sources tags from background script that I would like to make read only from a Modbus slave controller. For the script to be able to source the tag I needed to make it read/write, but this also allows writes from the modbus controller (which iX incorrectly thinks supplies the tag since it is the only assigned controller).

Thanks.

Re: Make tag read-only for specific controller

Posted: Thu Jan 03, 2013 9:23 am
by mark.monroe
The only permission settings for tags are the Access Right, which is set on a per tag basis. Will that not work for you? There is no other way to set tag permissions.
Snap 2013-01-03 at 08.22.13.png
Snap 2013-01-03 at 08.22.13.png (34.18 KiB) Viewed 14632 times

Re: Make tag read-only for specific controller

Posted: Thu Jan 03, 2013 9:40 am
by AMitchneck
When I set the access rights to read-only it disables my script from being able to modify and source the tag.

Re: Make tag read-only for specific controller

Posted: Thu Jan 03, 2013 9:55 am
by mark.monroe
If you make the tag read only, then it is read only from the controller, so you can not change the value of the tag in the HMI, because then it would change it in the controller. You can read the tag's value in script.

If you make it write only, then the controller can not change its value, only the HMI.

If you are changing the value of a tag in script, you should make sure that you set the tag as "Always Active". Otherwise the tag may not update the value on the controller. Only tags that are used on the screen are polled. Those used in a script need to be set as "Always Active" to be polled.

Re: Make tag read-only for specific controller

Posted: Tue Jan 08, 2013 9:18 am
by AMitchneck
I set all my tags that are set via script to "always active", but for some reason the tags "ValueChanged" event is not being fired when the tag is changed. Does this event not fire if the tag is modified via script?


To get a little deeper into my problem - I have a controller for which iX does not have a driver. To get around this I wrote my own custom script which talks to the controller over RS232 and updates tags. To enable customers to read tag values over Modbus TCP I also attached a Modbus slave controller to the tags read via my script. I need to be able to have the Modbus controller connected to the tags yet not disable the functionality of the script (and Tag events).

Thanks.

Re: Make tag read-only for specific controller

Posted: Tue Jan 08, 2013 9:32 am
by mark.monroe
The ValueChange event will fire when you change the value of the tag via a script. The ValueChange event will only fire if the value changes. If the tag value does not change, it will not fire the ValueChange event. Setting a Tag repeatably to 0, for example, will not fire the ValueChange event repeatably.

I tested this using iX Developer 2.0.463 running a TxA target project simulating the terminal on my PC.

Re: Make tag read-only for specific controller

Posted: Tue Jan 08, 2013 9:55 am
by AMitchneck
The ValueChange event fires for me only if the tag is not connected to the slave Modbus TCP controller. The moment I attach the controller the event stops firing.

Example tag:
Name: State
Type: Float
Access: Write
Modbus_TCP address: 40000
Initial value = 0
PollGroup1, Always active

Re: Make tag read-only for specific controller

Posted: Tue Jan 08, 2013 7:33 pm
by AMitchneck
I discovered the tag cannot be set as Write only. If I have it ReadWrite the ValueChange event fires.