One problem you have with the code is that you have 3 sections: one section creates and sends the commands to generate the pulse, another section creates and sends the commands to disable the output, and a third section performs data acquisition. There is nothing tying these 3 sections in terms of an execution order, so they can occur in any order. You should use the error cluster to enforce execution order.
That aside, you're not going to be able use software timing to accomplish generating a pulse for 30 milliseconds unless you're willing to tolerate a lot of fluctuations. At an absolute minimum you would need to put a delay between the pulse generation and the turning off operation. This would ensure that the pulse is on for at least 30 milliseconds. However, you have no way of controlling the upper limit since it's all software timed.
Is there a difference in your setup between having the output be zero Volts and it being disabled? One thing that you can try: rather than using one of the standard waveforms you can try to use the arbitrary waveform capabilities of the function generator. You can create your 30 msec pulse waveform using the LabVIEW functions and download it to the generator. You can download the drivers for that instrument from
here. There's an example in there that shows you how to use the arbitrary waveform generation.