fifa Posted November 15, 2010 Report Share Posted November 15, 2010 Hi, Can anyony help me to design a VI that will be capable of detecting and displaying the start index and the length of each thin patch. (Thin values are numbers of successive elements less than 1). Attached is a sample data to be used. Sample%20Data%2011.vi Quote Link to comment
jcarmody Posted November 15, 2010 Report Share Posted November 15, 2010 Here's a really rough start showing how to find your "thin patches"; you can work out the start and length from the Array of integers (or, build that as you go in the For Loop). Quote Link to comment
fifa Posted November 15, 2010 Author Report Share Posted November 15, 2010 Hi jcarmody, Thanks for your reply. I checked your VI and I realised that there is a missing count. if you have a look again you'll see that it miss a count from 13 to 16 instead to 17, from 46 to 49 instead to 50 and from 61 to 63 insteady to 64 I tried to make some changes to get it right with no success. Do you think it's ok the way it looks? Quote Link to comment
Jon Kokott Posted November 15, 2010 Report Share Posted November 15, 2010 There are built in labview functions that perform threshold tests. Additionally they are much more full featured and probably more useful for most applications. you might start with the peak detector. ~Jon Quote Link to comment
jcarmody Posted November 15, 2010 Report Share Posted November 15, 2010 Hi jcarmody, Thanks for your reply. I checked your VI and I realised that there is a missing count. if you have a look again you'll see that it miss a count from 13 to 16 instead to 17, from 46 to 49 instead to 50 and from 61 to 63 insteady to 64 I tried to make some changes to get it right with no success. Do you think it's ok the way it looks? You're right, but the start index is correct and you can just add one to the length. Quote Link to comment
fifa Posted November 15, 2010 Author Report Share Posted November 15, 2010 Ok that's fine now. Thanks for helping me out Quote Link to comment
fifa Posted November 17, 2010 Author Report Share Posted November 17, 2010 Hi I have made some change on the circuit the way it suppose to work but I still can not get the number of elements less than 1 for each index where values less than 1 starts. I have Attached the modified VI. I only need the number of elements for each thin patch. it sould look like this:Index 13 ------- 5 elements Index 46 ------- 5 elements Index 61 ------- 4 elements I will appreciate for any help LabviewQ2.vi Quote Link to comment
Francois Normandin Posted November 17, 2010 Report Share Posted November 17, 2010 Fifa, make sure that you state in which version you're VIs have been saved. Otherwise people will think they can open it with the version saved by default in your profile. I don't have LV2010 installed, so I can't get access to your code to chip in. If it's not saved in the default version of your profile, add a small note next to your VI. <a href="http://content.screencast.com/users/normandinf/folders/Jing/media/3cdc0ec4-d64a-48f4-9050-8497cd8f4d78/2010-11-17_0803.png"><img'>http://content.screencast.com/users/normandinf/folders/Jing/media/3cdc0ec4-d64a-48f4-9050-8497cd8f4d78/2010-11-17_0803.png"><img class="embeddedObject" src="http://content.screencast.com/users/normandinf/folders/Jing/media/3cdc0ec4-d64a-48f4-9050-8497cd8f4d78/2010-11-17_0803.png" width="461" height="390" border="0" /></a> Quote Link to comment
crossrulz Posted November 17, 2010 Report Share Posted November 17, 2010 (edited) You are almost there. All you really need to do is add logic to find the end of the patches and subtract indexes (see lower half of snippet). Note: If the data ends in a thin patch, you will not get a length out for that patch without some extra logic after this loop. Edited November 17, 2010 by crossrulz 1 Quote Link to comment
fifa Posted November 17, 2010 Author Report Share Posted November 17, 2010 Fifa, make sure that you state in which version you're VIs have been saved. Otherwise people will think they can open it with the version saved by default in your profile. I don't have LV2010 installed, so I can't get access to your code to chip in. If it's not saved in the default version of your profile, add a small note next to your VI. <a href="http://content.screencast.com/users/normandinf/folders/Jing/media/3cdc0ec4-d64a-48f4-9050-8497cd8f4d78/2010-11-17_0803.png"><img'>http://content.screencast.com/users/normandinf/folders/Jing/media/3cdc0ec4-d64a-48f4-9050-8497cd8f4d78/2010-11-17_0803.png"><img class="embeddedObject" src="http://content.screencast.com/users/normandinf/folders/Jing/media/3cdc0ec4-d64a-48f4-9050-8497cd8f4d78/2010-11-17_0803.png" width="461" height="390" border="0" /></a> Hi, Thanks for your reply here is the one saved in version 8.6 LabviewQ2.vi Quote Link to comment
fifa Posted November 17, 2010 Author Report Share Posted November 17, 2010 You are almost there. All you really need to do is add logic to find the end of the patches and subtract indexes (see lower half of snippet). Note: If the data ends in a thin patch, you will not get a length out for that patch without some extra logic after this loop. Hi Crossrulz, I've tried many times and I also ended up with 1s for the elements and many more other numbers, but I still could'nt get it right. So I am still strugling to get the right results. Anyway tanks a lot for what you've done Quote Link to comment
Saverio Posted December 7, 2010 Report Share Posted December 7, 2010 All should know that this is a homework assignment, confirmed over at the NI forum by professor who actually gave out the assignment. He has asked that no further help be provided. 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.