LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Please! Need urgent help for a simple case structure problem

Hi,
 
i am triying to graph square root of a sine wave.
 
because sine wave travels between +30 and -30 values, i can`t calculate its square root when it drops to negative.
 
so i have written a program by using a case structure (true/false). when sine wave is greater than zero true condition of the structure runs and only calculates the square root. while sine wave is at the negative side, false condition runs and it first calculates the absolute value then calculates the square root and finaly negates the value.
 
but my program does not work properly.
 
case structure is always running false condition.
 
would you please help me?
Can`t i put a sine wave as a condition to case structure?
 
i am attaching the program that i have written.
 
thank you.
0 Kudos
Message 1 of 12
(3,699 Views)
Hello LW-s,

I would do this like in the attached vi.

And no, you cannot check the sign of your waveform the way you did. The result of your check is just a single value, but you have multiple values in your waveform...


Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 12
(3,689 Views)

Hi LW-s

I've just modified your code to perform the required function.

Hope this helps.

Kurt Friday
www.sciware.com.au
0 Kudos
Message 3 of 12
(3,682 Views)
Hello LW-s,

just realized you work with LV6.0, so you get a picture...


Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 12
(3,670 Views)

Since you are using LabVIEW 6.0, I cannot attach an example that you can open.

Just take the square root of the absolute waveform, then multiply by the original sign of it. No case structure needed. 🙂

Message Edited by altenbach on 09-26-2005 08:33 AM

Message 5 of 12
(3,670 Views)

i couldn`t open the file you have attached probably because i am using labview 6.0.

would you please send it again in labview 6.0 format?

0 Kudos
Message 6 of 12
(3,662 Views)

i couldn`t open the file you have attached probably because i am using labview 6.0.

would you please send it again in labview 6.0 form?

0 Kudos
Message 7 of 12
(3,658 Views)
i have tried the way you have showed. but it gives error - different types of terminals connected  😞
is there a way that i can fix it?
 
 
0 Kudos
Message 8 of 12
(3,657 Views)

Maybe 6.0 has some restrictions on waveform math. You can always operate on the y values directly, similar to GerdW's suggestion. (Note that you don't need to deal with the other elements of the waveform.)

Message Edited by altenbach on 09-26-2005 09:08 AM

Message 9 of 12
(3,648 Views)

i just tried and it worked.

thank you very much for your help 🙂

 

0 Kudos
Message 10 of 12
(3,643 Views)