If, Then, Else Programming in FlexLogger

Updated Dec 26, 2023

Reported In

Software

  • FlexLogger

Issue Details

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?

Solution

The arithmetic formula channel supports the ternary operator which allows you to do it/else logic.  In this 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