Hi maggie_ok,
I took a look at your VI and see what you're trying to do. If you are doing this on a Windows system or any regular OS, you're probably not going to be able to make your Timed Loop execute much faster. 50Hz is actually already pretty fast. You'll probably need to do this on an FPGA to get better timing.
One thing you could try is to move the GPIB write section of your code (the code in the case structure) to a separate while loop. That would probably allow your main timed loop to execute faster. You could send the data needed for the GPIB write to a queue and have your while loop wait for data to appear in the queue before it executes a GPIB write.
Also, I just want to make sure I understand your timing requirements.
1. You need the timed loop to execute each turn at 1kHz.
2. You want to perform a GPIB write every tens of milliseconds.
3. You want to sample Ai at 1kHz.
4. You want to perform Ao at 1kHz.
I can't guarantee that you will be able to get the timing you need by using two separate loops and a queue, but it will probably be faster than your current code.
Hope this helps and let me know if you have any questions.
Mas Chano
Applications Engineer
National Instruments Japan