Showing results 1 to 6 of 6

Thread: Edit Variable limit (Delay)

  1. #1
    rloureiro Gast

    Default Edit Variable limit (Delay)

    Hi!!
    i would like to edit the limit delay of a variable during runtime. Is it possible?

    I want to have on another variable, the delay value (in seconds) of the limit of the first variable.

    Thanks in advance.
    Best regards,

  2. #2
    robertf Gast

    Default Re: Edit Variable limit (Delay)

    Hello rloureiro!

    It is possible to change the DelayTime at Runtime, but this manipulation is only temporary!

    That means, that a reloading of the project or restarting the runtime will bring back the settings configured in the editor!

    It is not possible to save this changes at runtime!

    Here is a small sample...


    Sub ChangeDelay()
      Dim zVAR As Variable
      Dim zLIM As Limit
       
        Set zVAR = thisProject.Variables.Item("WIZ_VAR_10")
        
        Set zLIM = zVAR.Limits.Item(0)
        Debug.Print "DelayTime: " & zLIM.DynProperties("DelayTime")
        
        zLIM.DynProperties("DelayTime") = 10
        Debug.Print "DelayTime: " & zLIM.DynProperties("DelayTime")
      
    End Sub

  3. #3
    rloureiro Gast

    Default Re: Edit Variable limit (Delay)

    Hi robertf,

    The script that you gave works fine.
    Thank you

    Best regards,

  4. #4
    rloureiro Gast

    Default Re: Edit Variable limit (Delay)

    Sorry robertf,
    One more question.
    I tried to change the limite value of variable in runtime.
    I can read the limit value of variable and show this value on runtime, but i can't change his value.
    It's possible to do this? (change the limite value in runtime)

    Thanks in advance.
    Best regards,

  5. #5
    robertf Gast

    Default Re: Edit Variable limit (Delay)

    Hi rloureiro!

    There is an easy solution without VBA...

    You can use additional variables for dynamic limits. Then you can set the limit-variables at runtime.

    The best would be to use variables from the Internal-Driver and the "Remanence" should be enabled...

  6. #6
    rloureiro Gast

    Default Re: Edit Variable limit (Delay)

    Thanks thanks
    Is an exelent idea, and solution

    regards

Posting Rules

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