# FlexLogger

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Two signals in one characteristic

Hello everyone,

I have a question about displaying two signals as one characteristic curve in the diagram in FlexLogger. I have a damper with two limit switches. If the damper is completely closed, signal 1 is high. If the damper is completely open, signal 2 is high. The time in between is the opening or closing time of the flap. According to the standard, the two signals should be displayed as in the attached picture. Is this possible with Flexlogger? Is it possible to link the signals and display them in this way?

Many thanks in advance

zarlex

Message 1 of 7
(720 Views)
Solution
Accepted by topic author zarlex

## Re: Two signals in one characteristic

I'm not sure if I completely understand the curve, but you could create a formula channel that combines the two signals. Go to "Add channels" in the toolbar and select Calculation>>Arithmetic formula and try something like this (it takes two digital channels and produces an analog result):

('Digital Signal 1' ? 1 : 0) + ('Digital Signal 2' ? 2 : 0)

Hope this helps,

Message 2 of 7
(697 Views)

## Re: Two signals in one characteristic

Thank you for your reply. It has helped me a lot. To get my diagram I have now used the following formula: ('Digital Signal 1' ? 1 : 0) + ('Digital Signal 2' ? 2 : 1). This is because both signals can be low at the same time when opening or closing the flap, but they can never both be high at the same time.

Many thanks and best regards
Zarlex

Message 3 of 7
(678 Views)

## Re: Two signals in one characteristic

('Digital Signal 1' ? 1 : 0) + ('Digital Signal 2' ? 2 : 0)

What does this formula say>

Where can I find syntax for this formula and others?

Message 4 of 7
(659 Views)

## Re: Two signals in one characteristic

This formula:
('Digital Signal 1' ? 1 : 0) + ('Digital Signal 2' ? 2 : 0)

Uses the ternary operator:https://en.wikipedia.org/wiki/Ternary_conditional_operator

The list of supported operators you can use for a formula in FlexLogger is here:
https://www.ni.com/docs/en-US/bundle/flexlogger/page/calculation-formula-options.html

The formula means:
If "Digital Signal 1" is True use 1, else use 0

If "Digital Signal 2" is True use 2, else 0.

When Signal 1 is True and Signal 2 is False, it will equal 1.

When Signal 1 is False and Signal 2 is True, it will equal 2.

If they are both true, it equals 3 and if they are both false, it equal 0.

Hope this helps,

Message 5 of 7
(652 Views)

## Re: Two signals in one characteristic

Thank you for the lesson.  I will be looking Ing into it more.   I will also post these links onto my r/FlexLogger reddit channel.

Message 6 of 7
(633 Views)

## Re: Two signals in one characteristic

Correction... r/FlexLoggerNI

Message 7 of 7
(620 Views)