Forum Home › Forums › Understanding the Software › Transfer value on button
- This topic has 6 replies, 2 voices, and was last updated 4 years, 11 months ago by
Mikhail.
-
AuthorPosts
-
February 5, 2021 at 4:59 pm #8252
hanjun941
ParticipantHello,
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 4 years, 11 months ago by
Mikhail.
February 6, 2021 at 4:49 am #8254hanjun941
ParticipantOr would I need to purchase the automatic control module? Does it support send commands like on event? SetVal(Val(101),102)?
February 6, 2021 at 4:20 pm #8255hanjun941
ParticipantI’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
February 7, 2021 at 6:45 am #8258
MikhailModeratorHi,
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.February 7, 2021 at 6:46 am #8259
MikhailModeratorIn case you need to calculate a difference, change the formula:
SetVal(102, Val(102) - Val(101))-
This reply was modified 4 years, 11 months ago by
Mikhail.
February 7, 2021 at 8:09 am #8265hanjun941
ParticipantHello,
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.
February 8, 2021 at 1:17 pm #8270
MikhailModeratorHello,
Please provide a screenshot of the Output channels table. -
This topic was modified 4 years, 11 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.