07-03-2018 10:12 AM
Hello,
I am working on a project where I am using two laser sensors, one at the top and one at the bottom. There is a conveyor line exactly between the sensors, and a continuous rubber strip is placed on it, whose thickness I would like to measure. I want to display it on a graph and also numerically, if possible.
I have attached a zip file that includes the code and an image that shows what I am trying to do. To get the thickness, my logic is that I basically have to calculate the distance between the line profiles which I want to show in the third blank graph. The code that I had earlier written for the calculation, you can see in the second image.
However, the result that I got with this code doesn't make any sense at all. Could anyone give me any hints of a better way to calculate this?
07-06-2018 12:23 PM
Cross post: https://forums.ni.com/t5/Real-Time-Measurement-and/How-to-continuously-measure-the-distance-between-...
If you have a graph on the screen you can get X,Y data out by right clicking and selecting export.
Your excel table doesn't seem to take into account the X data. Is that your intended behavior? If so, check out this code:
07-09-2018 05:12 AM
I understand your code and it gives me the desired results perfectly too, thanks!
But this will work after I gather all my data and then do the calculations, right? I would like to calculate the thickness variation in real time (when the lasers are powered on and the material is moving, I would like to see the thickness variation as a single line simultaneously). How do I go ahead with that? Use bundle and build array and then the same logic as you have used?
Also, I have attached the data from the two sensors (graphs) I am getting. Just one question about that, similar to the one which you had mentioned in your previous comment. I basically have X and Z data from the graphs. X is the length of the beam falling on the material and Z is the height. For calculating average thickness variation, my idea was to consider a particular window of X data, say 5 points (I have highlighted in the excel file), for both the sensors and then make the calculation with the corresponding Z co-ordinates. But I cannot think of a way to do this calculation in real time.
07-09-2018 05:14 AM
Please find the highlighted window of points here.
07-09-2018 12:21 PM
How about this:
07-11-2018 01:32 AM - edited 07-11-2018 01:34 AM
Hello nanocyte,
This already looks good. I am going to be away from work for a day or two. I will implement this in my code as soon as I return and get back to you. I am pretty sure it will work.
Many thanks.
07-13-2018 05:31 AM
This works perfectly. Thank you!