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.
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.
03-17-2010 07:13 AM
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
03-17-2010 07:24 AM
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.
03-17-2010 07:30 AM
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
03-17-2010 07:34 AM
Okay.
I will prepare an example during my next break.
Do you have sample data that I could use?
03-17-2010 07:37 AM
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!
03-17-2010 07:46 AM
03-17-2010 08:16 AM
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!
03-17-2010 08:26 AM - edited 03-17-2010 08:28 AM
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.
03-17-2010 08:31 AM
03-17-2010 08:37 AM
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