对升级后的项目进行故障排除
如果升级后的项目出现问题,请考虑以下准则。
升级到 1.6.0 或更高版本的项目
如果将低于 1.6.0 的项目升级到 1.6.0 或更高版本,请确保在 NetLogic 中将不支持的旧属性替换为新属性:
旧属性 | 新属性 |
---|---|
uint[] ParentArrayIndex | ElementAccess ParentElementAccess |
IUAVariable ParentArrayIndexVariable | IUAVariable ParentElementAccessVariable |
请考虑以下示例:
[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; //------------------------------------------------------------ }
小贴士:
如果升级报表中出现有关脚本或小组件中已弃用属性的错误,请从项目中移除受影响的脚本或小组件,然后再次添加。有关更多信息,请参见库。
troubleshooting
struct
upgrade
projects
uint[] ParentArrayIndex
IUAVariable ParentArrayIndexVariable
ElementAccess ParentElementAccess
IUAVariable ParentElementAccessVariable
提供反馈