All, I just wanted to add a note to point out that scripting is unsupported and you should be cautious about using it. In the VI attached you can not undo the cleaning of the wires. So if the results where not what you expected you are left with them.
Evan National Instruments