Hi Mark
i made a counter which works fine when i press button it starts and after a fixed value it stop.but whenever i press again button it didnot work.(Independently it works but when i merge this in my file with other code it didnot start with next press button)
i am sending code please tell me how it will reset and starts again when button press. I want a duration of 2 seconds. Led On for 2 second and then off.
record(bi, "b"){
field(SCAN, ".1 second")
field(ZNAM, "0")
field(ZNAM, "1")
}
record(calcout, "t"){
field(SCAN, ".1 second")
field(INPA, "b")
field(CALC, "A==1?1:0")
}
record(calcout, "counter"){
field(SCAN, ".1 second")
field(VAL, "0")
field(INPA, "counter")
field(INPB, "1")
field(INPC, "t")
field(CALC, "C==1&&(A<=9)?(A+B):A")
}
record(calcout, "reset"){
field(SCAN, ".1 second")
field(INPA, "counter")
field(CALC, "A<=9?A:0")
}
record(calcout, "rst"){
field(SCAN, ".1 second")
field(INPA, "reset")
field(CALC, "A==1?1:0")
}
record(b0, "out"){
field(SCAN, ".1 second")
field(OMSL, "closed_loop")
field(DOL, "rst")
field(ZNAM, "0")
field(ZNAM, "1")
}