From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to know when the voltage is over the X-axis

I want to know if I can know when a voltage or current or any data pass the X-axis?

 

I have 2 type of data, Current and Voltage, and I want to know which one will cross the X-axis first, can some one help me on that?

 

Because with that I will know if my system is inductive or capacitive.

 

Thanks

0 Kudos
Message 1 of 55
(3,289 Views)

The data, to plot a waveform, is usually an array (1D or 2D and occasionally 3D)

So you could search the array to find the first occurrence where the value goes negative or is equal to 0 (or goes positive if the signal is rising).  You can obtain the index in the array where it occurred and identify which signal has the lowest index (element) number.

 

Message 2 of 55
(3,275 Views)

Yes, in my case is a 2D array.

 

I need to measure that on each cycle, could you send me an example how to make it?

 

I thought something near that, I look at array and look when the number is over 0, but I didn't know how to make a code to look that!

 

Thanks 

0 Kudos
Message 3 of 55
(3,271 Views)

Okay.

 

I will prepare an example during my next break.

Do you have sample data that I could use?

0 Kudos
Message 4 of 55
(3,267 Views)

Sorry I don't have x(

 

But you can do any example on to show me how the code will work

and I study and adapt to my case!

 

Here I work with 4 voltages and 4 currents!

0 Kudos
Message 5 of 55
(3,265 Views)
Do you have the orgianl code so we can see what you are doing to better help with the solution?
Tim
GHSP
0 Kudos
Message 6 of 55
(3,260 Views)

Well, I have mate but the problem is the program that made it

ready another file recorded from another VI's

 

So I think is more easier you give me a basic solution and I will study it and adapt to my problem.

 

But if you want, I can upload it!

0 Kudos
Message 7 of 55
(3,244 Views)

Have a look at the code snippet.  The code can probably be improved using a For Loop, but this one should give you an idea of how to implement the solution.

 

I did not know the order of your data, so I called it top & bottom. 😉  It will also look for crossing the X-axis at the same time.

 

 

 

 

If values are increasing instead of decaying, then swap the Less or Equal to Greater than or Equal, and swap the less than to greater than.  I think you'll get the picture.
Message Edited by Ray.R on 03-17-2010 09:28 AM
Message 8 of 55
(3,238 Views)
I just wanted to see how you are processing the data and getting the data so that I can help with a solution that works for your application.
Tim
GHSP
0 Kudos
Message 9 of 55
(3,232 Views)

I have 8 channels Ray,

 

and I need to compare channel 0 to channel 4

so I have to index the arrays, right?

 

Thanks for the help =D

0 Kudos
Message 10 of 55
(3,231 Views)