LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Mathscript node executes the whole code all over again despite having an if cycle

Solved!
Go to solution
Solution
Accepted by topic author MichaelAsh

Hi Michael,

 

are there any options for running the first line only once (let's say outside of the while loop), and if cycles inside the loop?

Sure!

As you said yourself: "outside the loop" - more specifically "before the loop" according to THINK DATAFLOW…

 

if cycles

With your first message I wondered about that term.

Now I think you are talking about "if-then-else-endif" structures. (Never heard of calling them "cycles" before.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 11 of 12
(1,641 Views)

GerdW,

 

Is it right? Even my colleagues usually refer to "if-..." structures as cycles or loops. "Structure" only for official documentation. So pardon me, but you know..."potayto, potahto" 🙂 

 

I think I crack my code with initialization of some of the variables "before" the while loop and  with some native Labview structures. Thanks to everyone who helped me out to work this out. Hopefully this topic will be useful for Matlab coders as well.

0 Kudos
Message 12 of 12
(1,626 Views)