From your post here, I was under the impression that you wanted instrument A to output a pulse and then instrument B to output a pulse after some fixed delay. If that's true, you're not even close in your program. First, take all of the instrument setup out of the two loops and put them (one after another) outside and before a single loop. Instrument B should be configured for an external trigger source and instrument A should be configured to output a trigger. Set the trigger delay of instrument B to be what you want. Physically connect the trigger output of instrument A to the trigger input of instrument B. Then, inside of a loop, all you have to do is issue the software trigger command to instrument A. You could issue a software trigger to both instrument A and instrument B but the timing would not be very accurate and you certainly can't do it with two separate while loops.