Page 2 of 2 FirstFirst 1 2
Showing results 11 to 18 of 18

Thread: Sample How to create a OnlineContainer

  1. #11
    Join Date
    23.11.2009
    Posts
    22

    Default IVariable and get_Value during VariableBulkChange

    Hello,
    is it legal to get a zenOn.IVariable object reference (using OnlineVariable) and invoke get_Value method on it during a VariableBulkChange eventhandling?

    I'm experimenting a progressive working set memory growing in zenrt32 process, and this increment stops if I comment out zenOn.IVariable object reference inside my VariableBulkChange havent handler.

    Any information or suggestion about it?

    Thanks

  2. #12
    Join Date
    23.11.2009
    Posts
    22

    Default Re: IVariable and get_Value during VariableBulkChange

    Quote Originally Posted by zenmyway View Post
    Hello,
    is it legal to get a zenOn.IVariable object reference (using OnlineVariable) and invoke get_Value method on it during a VariableBulkChange eventhandling?

    I'm experimenting a progressive working set memory growing in zenrt32 process, and this increment stops if I comment out zenOn.IVariable object reference inside my VariableBulkChange havent handler.

    Any information or suggestion about it?

    Thanks
    I mean: acually I'm not sure where the memory leak is. Maybe it doesn't depend on zenOn VSTA.
    My question is just to ask if it is legal to use all the OnlineVariable methods (Item, get_Value, etc.) during a VariableBulkChange eventhandling.
    Thanks.

  3. #13
    martins Gast

    Default Re: IVariable and get_Value during VariableBulkChange

    hello,

    I would suggest you create a copy of the event instead of doing massive calculation in the VariableBulkChange event handler. This way you can be sure that no other change event occurs which overwrites your existing objects. So if the event occurs, you copy the parameters to e.g. a list or have a class that stores the information for you.

    regarding the memory leak - can you show me the code of the VariableBulkChange event so I can have a look at it?

  4. #14

    Default Re: IVariable and get_Value during VariableBulkChange

    Hello,

    I am using online container with just a few variables, i according to my test it is working, I can read online variables.
    My problem is about writing the variables.I want to send single command to 104 driver. When i set a variable in the CEL of Sicam230 i see that "Modify Spontaneous value (1)", however when i check the 104 driver-View Process Image i see that all i send is (0).

    I am using container.item(strCMD).set_Value(0,1);
    First parameter is object index(i am not sure about this), and second parameter is the value.

    What can be the problem?

    Thank you all in advance
    Last edited by yavaskoray : 10th July 2013 at 07:13

  5. #15
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: Sample How to create a OnlineContainer

    you have to know that:
    - only for reading a variable value via the zenon API (VBA/VSTA) you need to take care that a variable is advised at the driver and has a valid value (so .IsOnline() must return True
    - for writing a value to a existing variable you do not need an OnlineContainer at all
    -> just make the set value action direct on the variable

    regards,
    herbert


  6. #16

    Default Re: Sample How to create a OnlineContainer

    Quote Originally Posted by herberto View Post
    you have to know that:
    - only for reading a variable value via the zenon API (VBA/VSTA) you need to take care that a variable is advised at the driver and has a valid value (so .IsOnline() must return True
    - for writing a value to a existing variable you do not need an OnlineContainer at all
    -> just make the set value action direct on the variable

    regards,
    herbert
    Hello Herbert,

    Actually online container is my second way to do it, because without container also setting values did not work
    Without container i used
    thisproject.Variables().item(strCMD).set_Value(0,1);
    still i see in CEL modify spontaneous value(1), but when i check the 104 driver i see i send (0). My variable(strCMD) is 104 Single Command.

    I am supposed to send 1 and 0 after 100msec. But problem is i am sending 0 and then 0!!

  7. #17
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: Sample How to create a OnlineContainer

    I think the best would be in this case to contact the sicam support directly as their IEC870driver and also the their command processing differs compared to zenon.

    regards,
    herbert


  8. #18

    Default Re: Sample How to create a OnlineContainer

    Thank you, i contacted with support, the reason was a damage in the variable export file.

Similar Threads

  1. Replies: 0
    Last Post: 12th May 2010, 10:07
  2. Replies: 0
    Last Post: 12th May 2010, 09:58
  3. Sample How to use DynProbertiesEnum
    By tulon in forum VSTA
    Replies: 0
    Last Post: 16th March 2010, 09:05
  4. Replies: 5
    Last Post: 16th July 2009, 14:39
  5. Information Unlimited 16 - Sample
    By robertf in forum VBA
    Replies: 0
    Last Post: 28th November 2008, 13:34

Posting Rules

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