08-18-2005 01:11 AM
08-18-2005 08:45 AM
08-18-2005 01:13 PM
08-19-2005 12:33 AM - edited 08-19-2005 12:33 AM
Message Edited by pi-r on 08-19-2005 12:34 AM
08-19-2005 03:32 AM
Hi,
So, the PXI_startup VI is the Vi that's running on the PXI system.
So let me try to understand this. In the first structure you Initialize your hardware, so that's ok but the rest doesn't really look like a RT application. After the Initialization step you will use the TCP VIs to wait for a certain operation that has to be sent by the HostVI. So when you receive the commmand "1", you go to your Case 1 in the Case structure. You then start the Coil Test. Suddenly you are using Timed loops, that's no problem but you should use them everywhere then. Ok, so you start your Coil acquisition but in the meanwhile you are not able to accept a new Operation from the Host VI because you acquisition is still in progress and you have to Wait until the loop has finished. When your Coil test loop has finished then you can handle a new command from the Host VI again.
Btw: The TCP/IP listen VI and the Close connection VI have to be outside the While loop otherwise you are reopening the connection all the time which will cause delays.
Where are the two parallel loops? The Time-Critical loop and the Communication loop? The Communication loop with the TCP/IP communication must be able to run seperately from the acquisition loop. That way you can still handle another command from the HostVI while you are doing the acquisition. You really must have a seperate loop that only handles the TCP/IP communication at a lower priority and you must transfer the data between TCL loops and Com loops with RT FIFO's. Just check a simple application created with the RT Communication Wizard.
Maybe all of this was intended but it seems a bit strange.
If you execute the next case with the Read Galvas.vi (This one will have to wait until case 1 has finished) then I cannot find any RT structure. You first loop seems to put the data in the RT FIFO and the second loop sends the data to the host. This first loop is running at full processing speed at the same priority as the second loop which basically means that the first loop doesn't provide any sleep time for the second loop to execute. That's probably the main reason why the AcqData loop doesn't send data fast enough to the HostVI.
Use the RT System Manager (Tools menu) to check the CPU usage of your application. I'm almost sure that you will have a Time consuming loop or action somewhere that uses up all the CPU and that blocks communication.
I cannot rewrite the application but check the tutorials about the RT architecture on our website. I think that the way you have programmed your code now that you don't actually use the RT advantages.