04-03-2013 07:12 AM - edited 04-03-2013 07:17 AM
Hey Community,
i'm quite unexperienced with DASYLab and need some help with my schematics. I try to create an if-else condition and dont know what to do next.
Its my goal to analyse some input data for their values. If there is an input data between the value "0" to "4" i want to calculate this input with formula 1, if there is an input data between the value "4" to "8" it has to calculated with formula 2 (the two formulas are different).
I already created a combination with trigger and relay to evaluate which value the input data has, but then there is something missing. The input data has two channels but after the calculation i got four channels for each case. But i just want to have one result for each channel. -> the result input 1 should go to one output channel and the same for the second.
So i need a module that combines the two channels and delivers either result 1 or result 2 to one channel.
Which module that could be, something like a switch? I found nothing ...
Or is there any other solution for this problem?
Thanks for your help
Janem
Solved! Go to Solution.
04-03-2013 07:21 AM
You can do this in the formula itself.
Consider a formula module with one input and two outputs
CH0 - Output 0 ----------------------------------------------
(In(0) < 5) * (Your formula)
CH1 - output 1 ----------------------------------------------
(In(0) > 4) * (Your formula)
Now, if the In0 is true it will return one so the output will be your formula. If the In0 is false it will return 0 so the output will be 0
The two outputs can go to a summing module so that you will have always the correct signal
04-03-2013 07:45 AM - edited 04-03-2013 07:46 AM
Oh yeah quite simple, thank you for your fast answer!!!