LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

"if" dosnt work in mathscript node

Solved!
Go to solution

Hello

I have a strange problem in mathscript node, can u help me?

I just write a simple conditional style in mathscript node, but it dosent work and have attached error! my software has problem?

 

Best Regarsd

behzad

0 Kudos
Message 1 of 5
(6,575 Views)
Solution
Accepted by topic author behzad1

The problem is that your output "out" is undefined, as executed in your script. This might be what you want instead

 

out = -1; % define default value for out

if in == 7

  out = 6;

end

 

 

 

 

Kevin C.

0 Kudos
Message 2 of 5
(6,563 Views)

Hi

I really appreciate Kevin for his great help.  that was very Helpful to me.

can u help me about new problem in output too? when I set output  to zero or one, how can I convert to a boolean number? because  output with 0 or 1 , cant connect to a boolean LED.

 

Best Regards

behzad

0 Kudos
Message 3 of 5
(6,543 Views)
Solution
Accepted by topic author behzad1

use a !=0 before wiring to the led.

 

 

(Nothing of what you are doing requires the complications of the mathscript node. Why don't you just use plain LabVIEW instead?)

0 Kudos
Message 4 of 5
(6,540 Views)

Thank u altenbach.

actually I have a Complex Matlab code, that I just try to seperate code to small parts to Understand that and Easily transform to labview code. Integrated form is some difficult to debug.

 

Best Regards

0 Kudos
Message 5 of 5
(6,535 Views)