CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum
Deutsche Version English version russian version 
It is currently Wed Oct 18, 2017 12:05 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Open dialog via IEC code
PostPosted: Mon Nov 21, 2016 4:19 pm 
Offline

Joined: Thu Oct 13, 2016 4:19 pm
Posts: 48
Location: Presezzo, Bergamo (ITA)
Hi all,
I'm trying to open a custom dialog in my project (Codesys 3.5.9.30) without success.

I created a "Visualization" set as dialog with a couple of buttons and a rectangle with text.
In my main page, when the user click a button, I have to perform some operations and then, if the operations are completed, I need to open this dialog.
I tried with this code:

Code:
VAR_GLOBAL
    dialogMan : VisuElems.IDialogManager; // Dialog manager
    openSaveDialogConfirm : VisuElems.IVisualisationDialog; // Reference to the custom dialog
    pClientData : POINTER TO VisuElems.VisuStructClientData;
    visuRect : POINTER TO VisuElems.VisuStructSimpleRectangle;
END_VAR

// In my PLC_PRG
IF dwOperationResult = 0 THEN // The file already exist. Ask for overwrite
    GVL.openSaveDialogConfirm := GVL.dialogMan.GetDialog('Dialogs.ConfirmDialog'); // Get the reference to the FileOpenSave dialog
    (* Check if the dialog exist, if so try to open it *)
    IF GVL.openSaveDialogConfirm <> 0 THEN
        GVL.visuRect := ADR(GVL.pClientData^.rClientRect);            
        xResult := GVL.dialogMan.OpenDialog(GVL.openSaveDialogConfirm,ADR(GVL.pClientData),TRUE,GVL.visuRect);
    END_IF
END_IF


All references to the objects are set, the variable xResult becomes true but the dialog is not displayed.
I have no clue because the documentation is missing, can you help me?

Thank you,
Massimo


Top
   
PostPosted: Tue Nov 29, 2016 8:57 pm 
Offline

Joined: Tue Oct 04, 2016 10:13 am
Posts: 26
Take a look here viewtopic.php?f=25&t=7385
You can open dialog for each "logged" users on certain application event


Top
   
PostPosted: Wed Nov 30, 2016 8:43 am 
Offline

Joined: Thu Oct 13, 2016 4:19 pm
Posts: 48
Location: Presezzo, Bergamo (ITA)
Yes, you copied the example from codesys store; I did the same thing.

Actually my question becomes: why should I use OpenDialog4? What are the other three functions used for?


Top
   
PostPosted: Wed Nov 30, 2016 12:38 pm 
Offline

Joined: Tue Oct 04, 2016 10:13 am
Posts: 26
Here is simplified


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Wed Nov 30, 2016 2:28 pm 
Offline

Joined: Thu Oct 13, 2016 4:19 pm
Posts: 48
Location: Presezzo, Bergamo (ITA)
Thank you


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited