11-04-2014 12:49 PM
I’m working on a UT-scanner to find flaws in metal.
A PLC gives the coordinates of the X and Y position of a ultrasound sensor. The array is built in advance and gets filled while the process is active.
The coordinates are used in 2 intensity graphs and the Z-values will be analog values [0-10V] which represent the depth of a flaw and the intensity.
When the scan is complete I need to get an overview of the positions and amount of flaws.
Example:
If there are 10 flaws I would like to get the amount and the x/y-position of every point.
If 2 points are next to each other it has to be recognized as 1 flaw
Is there somebody who knows a way to do this or has some resources to get me started?
the project is inspired on :
USonic_C_Scan_Config FROM http://www.ni.com/example/28618/en/
Kind regards
Lars
11-04-2014 02:18 PM
You want to post-process the data?
Run a while loop. Initialize a Shift Register to 0. Feed the Array Size into the While Loop as an input. Index the array with the value from the Shift Register. Use "Greater or Equal?" to determine if the value is greater than your threshold. If so, increment your total errors, add the value to an array, and set a flag to let the loop know this iteration failed.
Check the output iteration vs the size. If output iteration is Equal or Greater than the size, you'll want to stop. You can wire the output directly to the stop terminal.
When the loop is flagged, don't add the value. Still check it. Just don't log it. Any time the value isn't greater than your threshold, set the flag to the opposite value. This will ensure you catch the next failure.