Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: script only work once

script only work once 1 year 10 months ago #1928

hello
I made a tag-type script and set the tag to run the script if it's value is above -1 which for a boolean tag should always be true. this tag is used for a switch control, but somehow, it only activated once and doesn't work after I flick the switch again.
how to make it so it will always activated when I flick the switch to either on or off?
The administrator has disabled public write access.

script only work once 1 year 10 months ago #1929

  • fatkhrus
  • fatkhrus's Avatar
  • Offline
  • Administrator
  • Posts: 826
  • Thank you received: 123
  • Karma: -107
Hello,

Tag dependent script is executed only when condition of the script toggle from FALSE to TRUE. If you want this script is executed permanently use General type script and check "Every cycle".

Best regards,
Ruslan
The administrator has disabled public write access.

script only work once 1 year 10 months ago #1930

can i use the "ondatachange" trigger to do it? because what I want is for the script to run when the value change from 0(false) to 1(true) and from 1(true) to 0(false).

how does the "ondatachange" trigger works too, btw? does it work if the tag I want to assign as the trigger is inside an "if" clause? if there are multiple tags value involved, does each one trigger the script?
The administrator has disabled public write access.

script only work once 1 year 10 months ago #1931

  • fatkhrus
  • fatkhrus's Avatar
  • Offline
  • Administrator
  • Posts: 826
  • Thank you received: 123
  • Karma: -107
Yes, you can use "OnDataChange". This is what you need. When values of tags included in this type of script are changed, this script is executed.

Best regards,
Ruslan
The administrator has disabled public write access.

script only work once 1 year 10 months ago #1932

but should it be a general type? or should it still be a tag type?

and does an ondatachange trigger script got triggered for each tag which value is changed included in the script if there are multiple tags involved?
The administrator has disabled public write access.

script only work once 1 year 10 months ago #1933

  • fatkhrus
  • fatkhrus's Avatar
  • Offline
  • Administrator
  • Posts: 826
  • Thank you received: 123
  • Karma: -107
It should be "General" type. Tags type is bound to tag. General you can't bound to tag in tag properties.
This script is executed when every tag's values included in this script are changed.

Best regards,
Ruslan
The administrator has disabled public write access.
The following user(s) said Thank You: kurotsubaki
  • Page:
  • 1
  • 2
Go to top