I was wondering if anyone has an example of how to open a dialog box using ONLY ST previous to the example version in the store. The issue that I have run into is fulfilling the pClientData without passing it through a button press on a screen. Is the pClientData something I can get without using a visualization element? I can open a dialog if I call the function from a visualization element and pass in pClientData.
I'm doing this with version 3.5.5.4
Thanks for your time.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes this is possible.
First you have to find out if any clients are available.
If yes, then you can call a function to open a dialog.
See below an example of a function you could call from your application whenever you want to open a dialog (pass the name of the visualization dialog as input):
FUNCTIONF_ShowDialogVAR_INPUTÂ Â sDialogName:STRING;END_VARVARÂ Â pstClientData:POINTERTOVisuElems.VisuStructClientData;Â Â itfDialogManager:VisuElems.IDialogManager;Â Â itfMyDialog:VisuElems.IVisualisationDialog;Â Â stVisuRect:VisuElems.VisuStructSimpleRectangle;END_VAR
VisuElems.VisuElemBase.g_ClientManager.BeginIteration();pstClientData :=VisuElems.VisuElemBase.g_ClientManager.GetNextClient();WHILEpstClientData<>0DO
  IFpstClientData^.GlobalData.ClientType=VisuElems.Visu_ClientType.TargetVisualizationTHEN
    itfDialogManager :=VisuElems.g_VisuManager.GetDialogManager();
    itfMyDialog :=itfDialogManager.GetDialog(sDialogName);
    stVisuRect.ptTopLeft.iX :=ANY_TO_INT(INT#0);
    stVisuRect.ptTopLeft.iY :=ANY_TO_INT(INT#0);
    stVisuRect.ptBottomRight.iX :=ANY_TO_INT(10);
    stVisuRect.ptBottomRight.iY :=ANY_TO_INT(10);
    itfDialogManager.OpenDialog(itfMyDialog, pstClientData, FALSE, ADR(stVisuRect));
  END_IF
  pstClientData :=VisuElems.VisuElemBase.g_ClientManager.GetNextClient();END_WHILE
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do you know if there is a way to tell which client fired the event to open the dialog. The issue we are running into is the buttons on the display we are using are triggered from a function block and not on the visualization screens. This means that all the soft touch buttons only tie to the visualization through POU's and not using the hotkeys configuration.
Can we tie these buttons to trigger a hotkey configuration? OR
Can we tell which client sent the request to only have that targetvisu or webvisu respond to open the dialog?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Do you know where I can find more information on the functions and methods being used? Putting a period at the end does not bring up anything and looking for it in the library doesn't help either.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I was wondering if anyone has an example of how to open a dialog box using ONLY ST previous to the example version in the store. The issue that I have run into is fulfilling the pClientData without passing it through a button press on a screen. Is the pClientData something I can get without using a visualization element? I can open a dialog if I call the function from a visualization element and pass in pClientData.
I'm doing this with version 3.5.5.4
Thanks for your time.
Yes this is possible.
First you have to find out if any clients are available.
If yes, then you can call a function to open a dialog.
See below an example of a function you could call from your application whenever you want to open a dialog (pass the name of the visualization dialog as input):
Thanks, that helps me a lot, but I have a question about this.
https://forge.codesys.com/forge/talk/Engineering/thread/d8839077a0/
Just wanted to say thank you TimvH.
Do you know if there is a way to tell which client fired the event to open the dialog. The issue we are running into is the buttons on the display we are using are triggered from a function block and not on the visualization screens. This means that all the soft touch buttons only tie to the visualization through POU's and not using the hotkeys configuration.
Can we tie these buttons to trigger a hotkey configuration? OR
Can we tell which client sent the request to only have that targetvisu or webvisu respond to open the dialog?
Do you know where I can find more information on the functions and methods being used? Putting a period at the end does not bring up anything and looking for it in the library doesn't help either.