Troubleshoot upgraded projects

Troubleshoot upgraded projects

If you encounter issues with upgraded projects, consider the following guidelines.

Projects upgraded to 1.6.0 or higher

If you upgrade a project lower than 1.6.0 to 1.6.0 or higher, make sure to replace old unsupported properties with new properties in NetLogics:
Properties to replace
Old properties
New properties
uint[] ParentArrayIndex
ElementAccess ParentElementAccess
IUAVariable ParentArrayIndexVariable
IUAVariable ParentElementAccessVariable
Consider the following example:
[ExportMethod] public void ChangeParentScalarIndex() { IUAVariable arrayVar = Project.Current.GetVariable("Model/ArrayVar"); DynamicLink myDynamicLink = arrayVar.Children.Get<DynamicLink>("DynamicLink"); //-------------------- 1.4.X IMPLEMENTATION -------------------- //Accessing parent array index in FactoryTalk Optix version lower than 1.6.0. //You can use monodimensional and multidimensional arrays. uint[] myArrayIndex = { 3 }; myDynamicLink.ParentArrayIndex = myArrayIndex; //You can only use the `ParentScalarIndex` property with a monodimensional array. //The following simplifies the access to the parent array index with a scalar value. //The following implementation is equivalent to the previous implementation. myDynamicLink.ParentScalarIndex = 3; //------------------------------------------------------------ //-------------------- 1.6.X IMPLEMENTATION -------------------- //Accessing parent array index in FactoryTalk Optix version 1.6.0 and higher. //Create an `ElementAccess` wrapper structure that exposes `ArrayIndexes` and `FieldIndexes`. //Use `ArrayIndexes` for arrays; Use `FieldIndexes` for structures. //Manage the access to an array or structure with `ParentElementAccess`. ElementAccess myElementAccessStructure = new ElementAccess(myArrayIndex); myDynamicLink.ParentElementAccess = myElementAccessStructure; //------------------------------------------------------------ }
TIP: If errors about depreciated properties in scripts or widgets appear in the upgrade report, remove the impacted scripts or widgets from the project and add the scripts or widgets again. For more information, see Libraries.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.