Instance Editing

Hi Guys, got a scenario for you…

A plant has 2 lines and both lines contain motors generated from a single type instance.

User Bob is a supervisor on Line 1 but he hasn’t had training on Line 2 so he has read/write access on Line 1 but read only access on Line 2

So I want to set up Line 1 Motor 1 to have permissions “Line1 Admin > Read/Write” and “Line1 Operator > Read Only”
And Line 2 Motor 1 to have permissions “Line2 Admin > Read/Write” and “Line2 Operator > Read Only”

Then assign Bob’s roles as “Line1 Admin” and “Line2 Operator”

Now, the problem I have is that I want to automatically generate motors and automatically set up the tag permissions.

I can manually override the roles in the tag by clicking on the grey circle but how do I do that via scripting?

Or am I going about this all wrong?

Cheers in advance

Steve

Add custom properties to the template of boolean type named Line1, and Line2
Then on the binding you are using for permission to Edit of the template create an expression of

{UDTName.Line1}&&hasRole(“Line1”)||{UDTName.Line2}&&hasRole(“Line2”)

Then when you drag the Template to a window, set either Line 1, or Line 2 to whichever line the window belongs to.

Thanks MM - works a treat