Hi Alex,
I can't see anything wrong with a brief look at your code, but I have two suggestions. First, create a simple VI that starts and stops an Analog Output task, to see if you can duplicate the behavior. This should definitely be your first course of action. Then, if you can duplicate the behavior, you can post the code, and I can look at it. If you can't duplicate the problem, then you will need to change your code. Some things I would suggest is to not use sequence structures nor global variables. You can instead create subvi's and just wire between the code. If you can't duplicate the problem, then you obviously know that it is not something with the hardware, and you just need to do something different in your code. I hope this helps.
Have a Great Day!
George