Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

create_boot_application() and 'Save As' message-box pop up

chab
2012-08-30
2014-12-12
  • chab - 2012-08-30

    When creating a boot application (offline), a 'Save As' message-box pops up. And a filename is requested.

    app = proj.active_application
    onlineapp = online.create_online_application(app)
    onlineapp.create_boot_application()
    

    Can I define the filename in my script and NOT get the 'Save As' message box?
    (This message box interrupts my automatic build. And human intervention is needed, which is not desired.)

    I found:

    system.prompt_answers["my message key"] = PromptChoiceFilter(MyFilter)
    system.prompt_answers["my message key"] = MultipleChoiceSelector(MyFilter)
    

    But I do not know if those will do the job.

    Did anyone use create_boot_application() and found a work-around for the message box?

    Regards,
    Edwin.

     
  • Anonymous - 2012-08-30

    Originally created by: M.Schaber

    Hi, Edwin,

    Edwin hat geschrieben:
    When creating a boot application (offline), a 'Save As' message-box pops up. And a filename is requested.

    app = proj.active_application
    onlineapp = online.create_online_application(app)
    onlineapp.create_boot_application()
    

    Can I define the filename in my script and NOT get the 'Save As' message box?
    (This message box interrupts my automatic build. And human intervention is needed, which is not desired.)

    I'm afraid, currently this is not possible. The current code in the online manager directly opens a file dialog, it is not possible to catch it using prompt_answers. Currently, there is no easy workaround except external tools like AutoIt.

    I did create CDS-30520 for this issue. You may ask your support contact to add your company or OEM as an interested customer to this issue.

     
  • francois - 2012-08-30

    I have been asking myself the same question. Would definitely speed up the build automation process!

     
  • chab - 2012-08-31

    Thank you Markus.
    As a work-around, I split my build process:
    First create all 'project'-files (without any user intervention) (considerable amount of time).
    Next create all 'boot application'-files (with user intervention) (several minutes).Regards,
    Edwin.

     
  • francois - 2014-03-12

    I see that CDS-30520 has been marked a duplicated of CDS-22407, which is now released under 3.5 SP2.
    It is now possible to use the IScriptApplication.create_boot_applicaton(String filename) method instead of using the onlineapp object.

    This is great, except that the visu files containing the images, text lists and webvisu files are not generated.
    The compilation context is also not saved
    Is there a simlar way to get those by specifying the path?

     
  • Anonymous - 2014-03-13

    Originally created by: M.Schaber

    Hi, Francois,

    francois hat geschrieben:
    I see that CDS-30520 has been marked a duplicated of CDS-22407, which is now released under 3.5 SP2.
    It is now possible to use the IScriptApplication.create_boot_applicaton(String filename) method instead of using the onlineapp object.
    This is great, except that the visu files containing the images, text lists and webvisu files are not generated.
    The compilation context is also not saved
    Is there a simlar way to get those by specifying the path?

    In our issue CDS-38204

    The create_boot_application will be ammended with two new parameters:

    Zitat:

    create_boot_application(output_filename, update_compile_info = false, write_visu_files = false)
    

    If the project was changed since the last download or online change to a PLC, and you create a boot application with update_compile_info set to True, this will overwrite the current compiler reference context with the one matching the boot project (which no longer matches the one on the PLC). Thus, a direct conline change to the PLC will no longer work. On the other hand, the reference context now matches the created boot application, so you can login to any PLC on which you deploy the generated boot application. This updated compile context is also the one to be included into a project archive.

    As a temporary workaround, you could also login to the PLC before creating the boot application, this should also write out the files.

     
  • francois - 2014-12-11

    I am trying to reproduce the same behaviour with the Automation Platform.
    So far, everything is compiled and generated, except for the visu files.
    Is there anyone that know how to export the visu files using the automation platform?

    What I have done so far:

    foreach (IApplicationObject5 app in applications)
    {
       lmm.Compile(app.ApplicationGuid);
       IDownloadInfo bootProjectInfo = lmm.GetOfflineBootProjectInfo(app.ApplicationGuid);
       IOnlineApplication17 onlineApplication = onlineManager.GetApplication(app.ApplicationGuid) as IOnlineApplication17;
       using (BinaryWriter writer = new BinaryWriter(File.Open(SAVE_PATH + app.ApplicationName + ".app", FileMode.Create)))
          onlineApplication.StreamDownloadCommand(writer);
       
       lmm.UpdateDownloadContext(app.ApplicationGuid);
    }
    

    Thanks!

     
  • mkeller - 2014-12-12

    Hi francois.

    Use GenerateCode(appGuid, false, false) instead of Compile(...).

    Get the Visual Manager object below the application and, if the object supports the interface IVisualManagerObject4, use CreateVisualizationFiles(stPath, true).

    BR
    Martin

     
  • francois - 2014-12-12

    Thanks M.Keller, works like a charm!

     

Log in to post a comment.