Thank you for your advise.
I'm going to look into how to convert my code into an ASCOM compatible application.