I have a tag1 and a tag_result.
I only want to save the first positive value that I encounter from tag1.
Like this:
tag1 | tag_result |
---|---|
-100 | 0 |
-200 | 0 |
100 | 100 |
200 | 100 |
-100 | 0 |
200 | 200 |
300 | 200 |
200 | 200 |
100 | 200 |
-200 | 0 |
I tried to do this:
1 if(
2 {[.]tag1} < 0,
3 0,
4 if(
5 {[.]tag_result} > 0, # already a value saved
6 {[.]tag_result}, # no change
7 {[.]tag1}
8 )
9 )
However, line 6 is given a error_confg
.
Any idea of why this could be?
As a temporal solution I'm using a script when ValueChanged in tag1
Thanks in advance!