DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the channel value after a comparison?

Does anyone know if there is "if else" command in Dasylab? I want to compare if an input value is positive or negative. I used interpretor module, but it only gave me True or False, not the value itself. I then tried logical operator and comaparator modules, but they only gave "TTL" signals. Any suggestions will be very appreciated.

Thanks

Message Edited by fzwq on 09-08-2008 04:58 PM
0 Kudos
Message 1 of 4
(7,186 Views)

Hi fzwq,

 

Have you tried using the Action Module? It sounds like you're able to make your comparison just fine, but then you want to perform some type of action resulting on the comoparison. Could you explain what you'd like the outcome of the "if else" command to be? For faster DASYLab support please see this forum. I hope this helps!

Message 2 of 4
(7,162 Views)

If you are in the formula interpreter module, you want something that looks like this....

 

(IN(0)>=4.2)*IN(0)

 

The test is the first part, which results in 0 or 1, then multiply by the value, and the output is 0 or the value.

 

To do If then else

 

(IN(0)>=4.2)*IN(0)  + (IN(0)<4.2)*(IN(0)*2)

 

Only one side will evaluate to a number, depending on the test.

You can use a compound test

 

((IN(0) >=4.2) AND (IN(0) <=5.0))  * IN(0)  will evaluate whether the input is in the range 4.2 to 5.0

and

 ((IN(0) >=4.2) OR (IN(0) <=5.0))  * IN(0) will evaluate whether the input is out of the range 4.2 to 5.0

 

Ensure that your test phrase is exclusive - you don't want both testing positive.

 

Note that the "=" operator is pretty picky.

 

Depending on what else you are doing, you could consider the Combi Trigger and a Relay combination. The Trigger is the test, and the output controls what the Relay will release. 

 

 

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
Message 3 of 4
(7,159 Views)

Guys, thank you so much. Lion-o, what cj says is what I would like to do. Really appreciate your help, smart!

0 Kudos
Message 4 of 4
(7,136 Views)