DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

Confusion over use of Formula Interpreter

Solved!
Go to solution

How do I evaluate a 4-bit input and output an integer value that I am need to map to a different value? Say that I'm evaluating the following inputs (4 in, 1 out):

 

(((IN(0) AND IN(1)) AND (IN(2) AND IN(3)) = 13) <= We know that 1111b is 15decimal, but I need to translate the value to 13 so that it represents the index of a worksheet that I'll be selecting with the Sequencer.

 

I am OR'ing each possible combination of the 4 inputs, and each combination needs to output a "special" value that I need to output to represent the index I need.

0 Kudos
Message 1 of 3
(6,647 Views)
Solution
Accepted by topic author Williamx

The result of a logical operation or comparison (OR, AND, =, <>, etc) is 0 (False, zero) or 1 (True, One).

 

Change the formula to

 

(IN(0) AND IN(1)  AND IN(2)  AND IN(3) ) * 13

 

In my limited testing, any non-zero value of the inputs will test TRUE, if any one is zero, then the output is zero, otherwise, the output is 13.

Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 2 of 3
(6,641 Views)

Hello WilliamX,

 

You can solve this application more flexible and very compact also with Addon Module "VBScript", sale via PREMEGA GmbH -> link under http://www.premega.de/de-02/software_dasylab_vbscript_de.php

 

Some screen shots for mainpoints from application:

17925iB970CDF15A7A5617

17927i5880B3E0546755BC
VB Script give you the chance to detect any useful bit combination and put out an value what you needs for this situation.
17929i0C936643608C099F

Best regards,

MHa

0 Kudos
Message 3 of 3
(6,466 Views)