11-06-2008
08:24 PM
- last edited on
11-10-2008
09:07 AM
by
Support
hello guys
first of all, thanks in advance for all the help you could provide me.
i am trying to work with some tables but i dont have much experience with them.
basically, i have implemented a VI that takes 2 sine signals with the DAQ, calculates an impedance value (by using the RMS values from the signals) and their phase difference.
my output values are Z and PHASE DIFF. these 2 are numeric values that change constantly. there are no loops or conditional stops on the program. right now, it just runs whenever i click the Continous run button.
what i need to do is to take 15 of both values (Z and Phase Diff), put them on a table and calculate their mean value. i was also thinking that stopping the program just after the 15 values of each output are taken.
can anyone please give me some help with this?! i will appreciate it! 🙂
11-06-2008 10:34 PM
11-06-2008 10:45 PM
thanks for the reply. indeed, i have lots of ideas regarding this. i do not know how to implement the table and the mean measurement after 15 values .
i was hoping someone could take a loot to what i have in the vi, and help me out with the table
11-08-2008 09:45 PM
11-09-2008 12:36 AM
moreins wrote:these 2 are numeric values that change constantly. there are no loops or conditional stops on the program. right now, it just runs whenever i click the Continous run button.
Well, the "continuous run" button is a debugging tool and should never be used for normal program execution. You need a loop.
moreins wrote:what i need to do is to take 15 of both values (Z and Phase Diff), put them on a table and calculate their mean value. i was also thinking that stopping the program just after the 15 values of each output are taken.
You could place your code inside a FOR loop, wire 15 to N, and autoindex the two values (as DBL) at the loop boundary. Feed the resulting two arrays to the "mean" primitive (mathematics ..probability&statistics palette) and you get your averages.
11-09-2008 08:30 AM
hello
thanks for the info. i believe this is what im looking for.
one question: can you please be mofe specific with the"autoindex" and the "dbl" terms? i dont understand this part
thanks
11-09-2008 10:16 AM
DBL means double precision. It is the representation of the number in memory. If you right click on a constant, indicator or control and select representation you'll see numerous choices such as double precision, single precision, complex, and signed and unsigned integers of various bit lengths.
Autoindexing is a type of tunnel for an array passing into or out of a loop. If you have a scalar value coming out of a loop, and the tunnel is autoindexing (changeable by selecting the tunnel and right clicking), the result is an array where each element of the array is a value from one of the loop iterations. If you pass an array into a loop with an indexing tunnel, the loop will act on each element of the array in turn. Kind of like a "For Each" statement.
11-14-2008 09:55 PM
Hello
thanks for all your support. I put my code inside a FOR loop and wired it to 15. I also took both results and wired them to a MEAN simbol using SLG. So far, my program takes 15 values and shows the mean. I need to do one final thing: how do i make the program stop after it takes the 15 values??
i will really appreciate your help with this! 🙂
11-17-2008 02:04 PM
Howdy moreins,
Your program will stop after all of the code inside has executed. The beauty of using a FOR loop is that after 15 iterations, the FOR loop will finish execution and pass control onto the next block of code. If this isn't the behavior you are seeing, I suggest posting a screenshot of your block diagram so that we can see exactly how you are implementing this design.
11-17-2008 02:24 PM
For some reason, that part of the conversation got moved into a new thread. http://forums.ni.com/ni/board/message?board.id=170&message.id=369036#M369036