Page 1 of 2 1 2 LastLast
Showing results 1 to 10 of 15

Thread: FileDialog

  1. #1
    Join Date
    12.04.2017
    Posts
    11

    Default FileDialog

    I am just learning zenon and am having trouble getting a file dialog box to open.  I need to have a filedialog box open when a button is clicked so that a file can be selected.  I have tried lots of different things but am just not getting it correct.  Can someone point me in the right direction.  I can provide the various code i have tried upon request.  

    Thanks for any help.

  2. #2

    Default Re: FileDialog

    Hi photomaddd,

    Thanks for your post and welcome to the forum

    Could you elaborate on the use case fur such a file selection dialog?
    Generally, a fully featured HMI can be created with zenon using standard functionality and without a single line of code in VBA / VSTA or the AddinFramework.

    Especially if you are beginning with zenon or creating your first project, I suggestion you focus on standard functionality without the enhanced possibilities that exist in the API.

    Best regards,
    Mark




  3. #3
    Join Date
    12.04.2017
    Posts
    11

    Default Re: FileDialog

    Mark,

    Thanks for your reply.  The client needs to select a file on a button click that will allow the selection of a file to import data for the machine to use.  Pretty simple stuff but I am new here and learning zenon.  I am curious about the code now because it has become a challenge.  Can you point me to some resources that will explain how to do it the way you suggested.  I haven't been able to complete any training yet. I am looking in to getting the training but in the meantime I am looking for solutions online.  I have searched but am not finding what I need.

    Thanks for your help. 

    Lisa

  4. #4

    Default Re: FileDialog

    Hi Lisa,

    Thanks for your elaborations. Could you explain a bit more what kind of data is in the file, what the source of the data is, how the data is formatted and what you expect zenon to do with this data for the machine?

    The standard recipes and the optional Recipegroup Manager module, allow writing sets of control parameters to the PLC. These control parameters can be managed by the user in a table but it is also possible to export these parameters into specifically formatted text files or xml files and import such files.

    Mark

  5. #5
    Join Date
    12.04.2017
    Posts
    11

    Default AW: FileDialog

    Mark,

    It is a text file that will give the machine some parameters, the source of the file will be a local server (I think). Right now I have just been tasked with opening a file selection window on the button click event. 

    Lisa

  6. #6

    Default Re: FileDialog

    Lisa,

    Can you tell me what do you expect zenon do with the file, once it has been selected?

    Would zenon need to read and parse this file and then write some values to PLC variables?

    Or would you expect zenon to send this file to the PLC in the machine, using one of the file transfer mechanisms that exist in several PLC communication protocols (DNP3, 61850 MMS, IEC 60870 101 / 104) ?

    Or would you expect zenon to send or forward this file through some other mechanism to the machine? (FTP, file copy, ...)

    Mark

  7. #7
    Join Date
    12.04.2017
    Posts
    11

    Default AW: FileDialog

    Mark,

    I would expect zenon would need to read and parse this file and then write some values to PLC variables.  Does what is done with the information affect how you open the dialog box to select the file?

    Lisa

  8. #8

    Default Re: FileDialog

    Lisa,

    I just wanted to better understand your use case and what you are trying to achieve, to possibly inform you about built-in functionality that does not require writing any code.

    When you can format the file freely and match the text file format to the import format needed for an import of a standard recipe, then you can configure zenon functions to first import the text file as a new standard recipe an then write the values in the recipe to the PLC variables. There would be no need for a file selection dialog.

    The operator would be able to specify the file name in a string variable, and the system could do the rest using standard zenon functions.

    Best regards,
    Mark


  9. #9

    Default Re: FileDialog

    Probably, what I'm also trying to say is, that having a file selection dialog in an HMI probably is not a great idea. If you can avoid it, this gives an operator no possibility to access the file system or windows system and only allows an operator to make use of HMI functions.

  10. #10
    Join Date
    12.04.2017
    Posts
    11

    Default AW: Re: FileDialog

    Mark,

    I understand.  Unfortunately, I was told to get the filedialog box to pop up and we will worry about the information later.  Can you point me in the direction of how to do this?  I am just learning so I would appreciate any help.

    Thanks very much,

    Lisa



Tags for this Thread

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •