I am using Codesys 3.5.7 for Wago (aka: e!Cockpit). I need to change the visualization within a frame using structured text, but only on the current client. Since the code is embedded in a button, I assumed the button would have a pointer to the client it is displayed on and have tried to access it via:
pClientData := THIS^._pCurrentClientData; // unless I'm mistaken, THIS should point to the current button, or at least the current visualization
iClientIndex := VisuElems.g_ClientManager.GetClientId(THIS^._pCurrentClientData);
pClientData := VisuElems.g_ClientManager.GetClientData(iClientIndex);
In both examples, it fails to compile with: Cannot convert type 'Unknown Type: 'THIS^._pCurrentClientData'' to type 'POINTER TO VisuStructClientData'.
I have checked the following example projects: Client Independent Visualization Switching, Visualization Switching, and Responsive Design. None of these give any example on how to determine what the current visualization is.
Also, does anyone know if there is a way to create client specific variables? I know if I can get an index for the current client I can simply use an array of variables, just wondering if there is a simpler way?
Thank you in advance.
Log in to post a comment.