vchavez

First of all thanks for the software it really is a good tool. I want to add some custom features.

Normally the _AddVariable method in controls/ VariablePanel.py adds new rows and its attributes can be changed manually by the name of the Name,Options,types,Class,etc.

What I would like to accomplish is e.g. modify all the variables from each POU that contain a variable named "repeatedVar" and change it to "theNewDynamicVar" automatically without user intervention and refresh the Variable panel for example with the RefreshValues(). For this reason I would like to know where should I look globally for the all the POU Variable Panels and access the RefreshValues() method externally or the Table.Data.

I do not understand completely how the Variable Panel is Called but correct me if Im wrong but it is Variable Panel >Editor Panel>Viewer>LD Viewer so I dont know if this would work or there is another class or method I should check to do what I described.

 

Quote 0 0
vchavez

I found a solution but Idk how good it is:

First I use the GetEditedElementInterfaceVars

Then I modify the values with SetPouInterfaceVars

After that I delete the Tab I want to update and Open it up again so the user can see again its last opened tab with EditProjectElement

Should that be enough? It works, but I have to close each opened tab and open it again so it refreshes the Values in the Grid Attributes, is there a cleaner way?

Quote 0 0