Showing results 1 to 5 of 5

Thread: Create a busy indicator

  1. #1
    Join Date
    29.07.2007
    Location
    Linz
    Posts
    50

    Default Create a busy indicator

    Hello,

    I use a VBA procedure to analyse and write huge files.
    It takes a while to write all the data to the files.

    To show the user, that the application is busy but didn't crash, I would like to display a hourglas (or something else).
    I think it should be something like this:

    display hourglas
    ... do all the file I/O...
    hide hourglas

    Normally in VBA there is a DoCmd.Hourglas method. But DoCmd class is not available in my modules.

    Thanks in advance.

    Alex

  2. #2
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default AW: Create a busy indicator

    It takes a while to write all the data to the files.
    To show the user, that the application is busy but didn't crash, I would like to display a hourglas (or something else).
    -> this is not the right way to do such things
    -> the time where VBA is executing all that staff it also influence the performance of the zenon runtime

    VBA is running in the same thread as the application itself. If you execute i.e. in MS Excel VBA a endless-loop it will be not possible to edit i.e. cells or doing things in MS Excel at all.

    The same for VBA in zenon. If you are executing a VBA Makro the zenon Runtime main thread will be halted in some way.

    If you have to do heavy calculations or other stuff via the programming which takes a long time and/or produces heavy load on the CPU we strongly would recommend to do this either via VSTA with using a sperate thread or an external application (i.e. VB6,... )

    regards,
    herbert

  3. #3
    Join Date
    29.07.2007
    Location
    Linz
    Posts
    50

    Default AW: Create a busy indicator

    This is an old application, built in ZenOn 6.20. So VSTA is not available and I can't refactor the application.

    The data will be collected in RDA3 archives. After the archive is stopped and exported all the File IO starts. So it's not that problem if the VBA procedure stops the zenon thread for some seconds. But I want to display it to the user.

    I know that the software architecture is not the best but we must not change it yet.

    Regards,
    Alex

  4. #4
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default AW: Create a busy indicator

    Which function do you use to export those archives?
    Is it then zenon function "export archives" itself?

    What you can do (instead of VBA) that you simply open a small zenon picture (i.e. with a hour glass on it) before you start the export (i.e. put the picture switch function and the export archive function into a script). The zenon picture itself you define as modal -> thus no further operation in the zenon runtime will be possible).
    Of course you need a kind of timer which closes the picture again:
    - create a internal bool variable at which you define at limit "1" a delay time for i.e. 5 seconds (or whatever which time you need)
    - at the start function of the screen you link the function which sets this bool variable to "1"
    - at the start function of the screen you link the function which sets this bool variable to "0"
    - at the internal bool variable at limit "1" you link a function which closes the modal hour glass screen again

    regards,
    herbert

  5. #5
    Join Date
    29.07.2007
    Location
    Linz
    Posts
    50

    Default AW: Create a busy indicator

    I use the built in function "export archives".

    The VBA procedure is defined within a script. I added a function to the script that displays a modal dialog. When the VBA procedure is finished, the dialog will be closed.

    One more question:
    If I add several functions to a script, are they executed one after the other? I mean, does function 2 only start if function 1 has finished?

    regards,
    alex

Similar Threads

  1. Create an Element
    By robertf in forum VBA
    Replies: 7
    Last Post: 11th June 2014, 07:44
  2. Create an interlocking
    By davide.galigani in forum VBA
    Replies: 1
    Last Post: 9th July 2012, 11:20
  3. How to create Events
    By eigehr in forum VBA
    Replies: 4
    Last Post: 10th June 2012, 23:27
  4. reset of Drag indicator
    By roberto1978 in forum zenon Supervisor
    Replies: 3
    Last Post: 15th March 2012, 00:16
  5. Can not create new project.
    By jnkpanchal008 in forum zenon Supervisor
    Replies: 6
    Last Post: 29th November 2011, 14:30

Posting Rules

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