# FlexLogger

cancel
Showing results for
Search instead for
Did you mean:

Solved!
Go to solution

## if, then, else programming in FlexLogger

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

Message 1 of 3
(1,465 Views)
Solution
Accepted by topic author zarlex

## Re: if, then, else programming in FlexLogger

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!

Message 2 of 3
(1,432 Views)

## Re: if, then, else programming in FlexLogger

Hi Devin,

Thank you very much. It works perfectly.

best regards

zarlex

Message 3 of 3
(1,410 Views)