You have made a classic mistake. You've placed the Initialize and Close inside the loop. The Initialize will, by default, perform a device reset, which turns off the output. Initialize outside a loop, do your stuff inside, and then close outside the loop.
In terms of your code: I would strongly recommend looking at the Ramp Pattern function. It appears that you want to increase voltage settings, resetting to zero in between. This can be easily done by creating your ramp of the increasing voltages, and then creating another array of zeros of the same size, and then interleaving the two arrays. This will give you a full array of voltage values, without needing two loops, and determining which step you're on, etc., etc. For example, the following code will give you the 5, 0, 10, 0, 15, 0 sequence quite cleanly:
Also, never perform an equality comparison on floats. Otherwise, you owe me another nickel in my retirement fund.