Showing results 1 to 8 of 8

Thread: Access New CEL item event from VBA

  1. #1
    karimsaikali Gast

    Frage Access New CEL item event from VBA

    With the Alarm object in VBA, there is the event
    obAML_AlarmComes(ByVal obItem As IAlarmItem)
    which alert us of a new alarm

    We did not find any way to do the same with the CEL object!
    the only event that we found with the CEL object is 'zCEL_CelListSelectionChanged'

    Is there any event like the alarm that will alert us of a new CEL event like the obAML_AlarmComes?

  2. #2
    select as best answer

    Default Re: Access New CEL item event from VBA

    If you declare an object of the type "CEL" with events, you have the possibility to react on the following two events:

     Public WithEvents celObject As Cel
     
    Private Sub celObject_CelItemAdded(ByVal obItem As ICelItem)
    End Sub
     
    Private Sub celObject_CelListSelectionChanged(ByVal obItem As ICelItem)
    End Sub
     
     
    'in the event "Project_Active the celObject must be set
    Private Sub Project_Active()
    Set celObject = thisProject.Cel
    End Sub
     
    'in the event "Project_Inactive the celObject must be set to nothing (destroyed)
    Private Sub Project_Inactive()
    Set celObject = Nothing
    End Sub

  3. #3
    karimsaikali Gast
    select as best answer

    Daumen hoch Re: Access New CEL item event from VBA

    Thank you Mark !

  4. #4
    karimsaikali Gast
    select as best answer

    Cool Re: Access New CEL item event from VBA

    Although IN ZENON 6.2, Withevents declaration is possible for the CEL object to trigger event _CelItemAdded(ByVal obItem As ICelItem),
    in Zenon 5.5 CEL object does not support event based declaration.

    Is there anyway in Zenon 5.5 sp6 to get the active CEL listing?

  5. #5
    select as best answer

    Default Re: Access New CEL item event from VBA

    unfortunately, in zenon 5.50 this functionality was not yet available.

    Only the Alarm object can be declared with events, but the event for the item selected in the list, and the "ItemAdded" is also not availalbe here yet in this version.

    where do you need this functionality for, in zenon 5.50?

    Would it be possible to update, e.g. to 6.22 SP1?

  6. #6
    karimsaikali Gast
    select as best answer

    Default Re: Access New CEL item event from VBA

    Unfortunetly, no update is possible; but i was thinking of replacing the 'zenrt32.tlb' used by Zenon 5.5 by the 'zenr32.tlb' used by Zenon 6.1 or Zenon 6.2
    Important considerations are:
    1- The Zenon project does not contains VBA code
    2- Our application is an external VB6 application

    I did not try it yet, but even if it works, are there any hidden problems of doing it?

  7. #7
    select as best answer

    Default Re: Access New CEL item event from VBA

    the .tlb being used MUST always match exactly the zenon version which is being used!

    Using a .tlb of a different version will lead to unexpected behaviour and may crash the runtime.

    Even if you would be able to use the .tlb of a newer version, which has the event in the object description, and it does not crash when you use it, the event will still not be generated by the runtime.

    sorry that I don't have better news for you. What is it exactly, that you want to do? Maybe this could also be done cycically? (e.g. exporting the CEL and evaluating the export file)

  8. #8
    karimsaikali Gast
    select as best answer

    Default Re: Access New CEL item event from VBA

    In fact there are 7 stations running 5.5;We decide to not alter project file on each stations;
    This is the reasons we used VB6 external application;
    At the back end there is Zenon 6.2 centralizing all info;

    I wil used a sort of gateway for CEL that i have developed that is configured to read from a text file all variables that we want in the 'CEL' (not Zenon CEL, but rather a module custom made),
    Then we will use container online variables on those variable to fill an sql server table that looks exactely like the Zenon CEL; with an sl trigger on this table i can even assign old value on each 'CEL' record;
    The disadvanges of using online variable container on having the CEL events is that i must include a configurable text file with all variable of interest whereas with the CEL event i do not even need to know which variables i want to log into the CEL.
    Of course we peform dramastic amount of work to develop this add-on for not altering the system performence and most of all to be debug free because any malfunction or waiting time in the add-on will slow down the performece of the zenon application

Similar Threads

  1. Drawn event
    By flajoso in forum VBA
    Replies: 5
    Last Post: 26th August 2008, 11:09
  2. Delete item in a combobox
    By fabios in forum VBA
    Replies: 2
    Last Post: 11th July 2008, 10:43
  3. Replies: 1
    Last Post: 6th May 2008, 12:43
  4. The event OnElementCreated is not executed
    By markclemens in forum VBA
    Replies: 0
    Last Post: 21st February 2008, 14:31
  5. VBA and Microsoft Access
    By bjoerndavid in forum VBA
    Replies: 2
    Last Post: 30th November 2007, 22:22

Posting Rules

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