newLVuser Posted December 21, 2009 Report Share Posted December 21, 2009 Hello, I posted a topic to get help with a simple pass/fail counter. That helped me a lot with my application. Now I want to count the failure type, I'd like to use a boolean array as the input. I hope you can help. I'm attaching the original counter, and the idea I want to implement... Quote Link to comment
Sharon_ Posted December 22, 2009 Report Share Posted December 22, 2009 Hello, I posted a topic to get help with a simple pass/fail counter. That helped me a lot with my application. Now I want to count the failure type, I'd like to use a boolean array as the input. I hope you can help. I'm attaching the original counter, and the idea I want to implement... Hi, Here is the solution to the problem. -Sharon Quote Link to comment
jcarmody Posted December 22, 2009 Report Share Posted December 22, 2009 [...] Now I want to count the failure type, I'd like to use a boolean array as the input. [...] I'm assuming that each element in the input array represents the result from one of multiple tests, not multiple results for one test. I think this is what you're looking for. Sharon_'s post is your answer if I've got it backwards. ResultTotals.vi Quote Link to comment
newLVuser Posted December 22, 2009 Author Report Share Posted December 22, 2009 Hi, Here is the solution to the problem. -Sharon Thank you for your answer but jcarmody's post is what I'm looking for. Quote Link to comment
newLVuser Posted December 22, 2009 Author Report Share Posted December 22, 2009 I'm assuming that each element in the input array represents the result from one of multiple tests, not multiple results for one test. I think this is what you're looking for. Sharon_'s post is your answer if I've got it backwards. Thanks for replying jcarmody. I think this is what I am looking for. But I've got some doubts... Please see the attached. Quote Link to comment
jcarmody Posted December 22, 2009 Report Share Posted December 22, 2009 Thanks for replying jcarmody. I think this is what I am looking for. But I've got some doubts... Please see the attached. Those are the First Call function. They return True the first time they're called and I use them to initialize the data that will go in the Shift Registers. Without them the arrays I'm passing around won't be initialized properly. I have to initialize them to the size of your results array inside the While Loop, but I can't have it happen every time the Loop iterates or you'll lose your ability to count. The True case should contain the Array Initialize because it must happen only once, at the First Call. Similar thing for the Total scalar; if I don't initialize it to zero the first time in it'll keep incrementing every time it runs and the count will be off. Quote Link to comment
newLVuser Posted December 22, 2009 Author Report Share Posted December 22, 2009 Those are the First Call function. They return True the first time they're called and I use them to initialize the data that will go in the Shift Registers. Without them the arrays I'm passing around won't be initialized properly. I have to initialize them to the size of your results array inside the While Loop, but I can't have it happen every time the Loop iterates or you'll lose your ability to count. The True case should contain the Array Initialize because it must happen only once, at the First Call. Similar thing for the Total scalar; if I don't initialize it to zero the first time in it'll keep incrementing every time it runs and the count will be off. OK...I will try your program and let you know. I'll write it because I have LV7.1 Thanks a lot. Quote Link to comment
newLVuser Posted December 22, 2009 Author Report Share Posted December 22, 2009 Those are the First Call function. They return True the first time they're called and I use them to initialize the data that will go in the Shift Registers. Without them the arrays I'm passing around won't be initialized properly. I have to initialize them to the size of your results array inside the While Loop, but I can't have it happen every time the Loop iterates or you'll lose your ability to count. The True case should contain the Array Initialize because it must happen only once, at the First Call. Similar thing for the Total scalar; if I don't initialize it to zero the first time in it'll keep incrementing every time it runs and the count will be off. I have checked the BD and it looks good. I can not make it work properly. I always get 0's... BD, FP and VI are attached. Untitled.vi Quote Link to comment
jcarmody Posted December 23, 2009 Report Share Posted December 23, 2009 I have checked the BD and it looks good. I can not make it work properly. I always get 0's... BD, FP and VI are attached. [...]The True case should contain the Array Initialize because it must happen only once, at the First Call.[...] I read your note about LabVIEW 7.1 but didn't connect it with your question about the True case. All of the images I post are VI snippets, so the code is in the picture, but you'd need LabVIEW 8.6 to get it out. Sorry. I added the Array Initalize to your code and it worked. Food for thought: your Case Structure wasn't doing anything so you were trying to replace an element in an empty array. You experienced that it won't work. One thing to note is that the constant 8 elements is specific to the number of elements in your boolean Results array. You'd be better off programmatically determining the length of that array, but you need to size it appropriately if you change the number of tests you're tracking. PS - Take a look at the Code Capture Tool. It makes capturing and annotating BD & FP images easy. Quote Link to comment
newLVuser Posted December 23, 2009 Author Report Share Posted December 23, 2009 I read your note about LabVIEW 7.1 but didn't connect it with your question about the True case. All of the images I post are VI snippets, so the code is in the picture, but you'd need LabVIEW 8.6 to get it out. Sorry. I added the Array Initalize to your code and it worked. Food for thought: your Case Structure wasn't doing anything so you were trying to replace an element in an empty array. You experienced that it won't work. One thing to note is that the constant 8 elements is specific to the number of elements in your boolean Results array. You'd be better off programmatically determining the length of that array, but you need to size it appropriately if you change the number of tests you're tracking. PS - Take a look at the Code Capture Tool. It makes capturing and annotating BD & FP images easy. Thank you, that solved my problem. The program does what I want. And thank you for for the Code Capture Tool link... it's very useful. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.