12-06-2023 02:57 AM
Hello everyone,
I would like to realize an if, then, else programming in FlexLogger and I don't know how to implement it.
I want to display a pressure. If p<0.1Pa, then p=0.1Pa should be displayed, else(p>0.1Pa) p=p should be displayed.
Is this possible with an arithmetic formula? Or is there another way to implement this?
I would be very grateful for your help.
Best regards
zarlex
Solved! Go to Solution.
12-06-2023 08:33 AM - edited 12-06-2023 08:35 AM
Hi zarlex,
Yes, the arithmetic formula channel supports the ternary operator which allows you to do it/else logic. In your case, assuming the channel name is 'p', the formula would look like:
'p' < 0.1 ? 0.1 : 'p'
Or you could invert the logic and write it this way
'p' >= 0.1 ? 'p' : 0.1
Hope that helps!
12-07-2023 03:47 AM
Hi Devin,
Thank you very much. It works perfectly.
best regards
zarlex