You can head to the security setting and add a custom privilege named WriteLocked. Where you add this, click the box to show privilege numbers (your's will probably be 16). Then in your I/O tags I/O tab, you will see a privilege dropdown. You should see your custom privilege is available here.
Right-click on the dropdown and select add a parameter expression. Your expression should look something like the following, which will lock tag writes if [PathToControlTag] = 1:
PickValid([PathToControlTag],0) == 1
? invalid
: 16
Before you click ok on the expression, deselect the 'optimize to only evaluate at...' box, so this will be continuously monitored rather than only checked when the app is launched.
The PickValid() function is there to ensure that your conditional statement resolves such that you can write values if, for some reason, your control tag is invalid.
Note that a change in the control tag will cause the tags with the custom expression to restart, so if you plan to do this on thousands of tags, you will see a performance hit. Note that if you don't want to add this expression everywhere, you can also link your expression to the result of a calc tag and place the code above in the calc tag.
I'm sure you'll have more questions but remember you can read up on things like PickValid() by pressing F1 in VTScada to launch the help files.
Good luck, and let us know how this works out for you. I tested it locally, and it worked well for me.
You can head to the security setting and add a custom privilege named WriteLocked. Where you add this, click the box to show privilege numbers (your's will probably be 16). Then in your I/O tags I/O tab, you will see a privilege dropdown. You should see your custom privilege is available here.
Right-click on the dropdown and select add a parameter expression. Your expression should look something like the following, which will lock tag writes if [PathToControlTag] = 1:
````
PickValid([PathToControlTag],0) == 1
? invalid
: 16
````
Before you click ok on the expression, deselect the 'optimize to only evaluate at...' box, so this will be continuously monitored rather than only checked when the app is launched.
The PickValid() function is there to ensure that your conditional statement resolves such that you can write values if, for some reason, your control tag is invalid.
Note that a change in the control tag will cause the tags with the custom expression to restart, so if you plan to do this on thousands of tags, you will see a performance hit. Note that if you don't want to add this expression everywhere, you can also link your expression to the result of a calc tag and place the code above in the calc tag.
I'm sure you'll have more questions but remember you can read up on things like PickValid() by pressing F1 in VTScada to launch the help files.
Good luck, and let us know how this works out for you. I tested it locally, and it worked well for me. :)
Trihedral Engineering Ltd.