Jump to content

Failure type counter


newLVuser

Recommended Posts

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.

post-16569-126146950831_thumb.jpg

-Sharon

Link to comment

[...] 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.

post-7534-126148434768_thumb.png 

ResultTotals.vi

Link to comment

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.

post-7534-126148434768_thumb.png

Thanks for replying jcarmody.

I think this is what I am looking for. But I've got some doubts...

Please see the attached.

post-16871-126149220944_thumb.jpg

Link to comment

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. 

Link to comment

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.

Link to comment

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.

post-16871-126150945818_thumb.jpg

post-16871-126150946663_thumb.jpg

Untitled.vi

Link to comment

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.

post-7534-126156878612_thumb.png

PS - Take a look at the Code Capture Tool.  It makes capturing and annotating BD & FP images easy.

Link to comment

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.

post-7534-126156878612_thumb.png

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.

post-16871-126157739354_thumb.gif

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.