Try the routine posted at http://www.eng-tips.com/viewthread.c...=137568&page=1