Transfer value on button

Forum Home Forums Understanding the Software Transfer value on button

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #8252
    hanjun941
    Participant

    Hello,

    So let’s say I have an input channel that is constantly changing its value, but I want the value be deducted by its own value which is saved in a calculated input channel when I click a button.

    So let’s say at 1seconds the input 101 is 5
    at 2seconds the input 101 is 7
    I want it so that at second 1 if I click the button, the current value i.e. 5 is saved as a value in my calculated input channel 102 using the formula Val(101), I set input 101 formula to be Cnl(101)- Val(102)
    Do you have any advice on how to configure the button so that it does that?

    Thanks

    • This topic was modified 3 years, 2 months ago by Mikhail.
    #8254
    hanjun941
    Participant

    Or would I need to purchase the automatic control module? Does it support send commands like on event? SetVal(Val(101),102)?

    #8255
    hanjun941
    Participant

    I’ve been trying to wrap my head around this, so basically can I set a formula in a calculated variable to only update when I click a button, I have tried setting the calculated variable which uses Val() to not active but it still updates constantly.

    Thanks

    #8258
    Mikhail
    Moderator

    Hi,

    I think, you don’t need Auto Control Module for this purpose.
    Create an output channel, and define this channel number for a button.
    When button clicked, a command is sent, and a formula of the output channel is calculated.

    The formula may be like this:
    SetVal(102, Val(101))
    where 101 is the input channel you need to save
    102 is the input channel of the calculated real type that stores the saved value.

    #8259
    Mikhail
    Moderator

    In case you need to calculate a difference, change the formula:
    SetVal(102, Val(102) - Val(101))

    • This reply was modified 3 years, 2 months ago by Mikhail.
    #8265
    hanjun941
    Participant

    Hello,

    I tried that, but the send command asks me to input and value, when I put it to Send Command Now, nothing happens. What’s the difference between send command and send command now?

    Thanks.

    #8270
    Mikhail
    Moderator

    Hello,
    Please provide a screenshot of the Output channels table.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.