ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

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
(7,586 Views)
Solution
Accepted by 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
(7,574 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
(7,554 Views)
Solution
Accepted by 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
(7,551 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
(7,546 Views)