I´m writing a program in which I receive data from a GPIB and a RS485 port. I´m trying to optimize the program, to make it as fast as I can.
Therefore I have built two parallel loops in one VI, one for the RS485 and one for the GPIB. The data from both loops´re concatenated after to save them in a file. The operations in the RS485-loop take exactly 400 ms, the operations in the GPIB-loop need also 400ms. If I run the VI with the two parallel loops it takes 700ms. Why? Normally the VI should need only 400ms because the single loops work with different resources and each need only 400ms because the connected devices´re so slow - not my computer. My computer is not working to capacity. What can I do to have to independent tasks? Do I have to write two VIs, one for the GPIB and one for the RS485?
-- Ciao Max
* Max Weiss/Kaiserstr. 188/76133 Karlsruhe/0721 2030339/Germany * * max@mvmpc9.ciw.uni-karlsruhe.de/DB8MWE *
Make sure that they start at the same time for them to end at the same time. Either by data flow or you could use Rendevous or some other synchro method.
Use the rating system, otherwise its useless; and please don't forget to tip your waiters! using LV 2010 SP 1, Windows 7 ________________________________________________________
Make sure each loop has a wait function. This allows LV's internal scheduler to switch tasks between the two loops. If one or both loops lack a wait function that loop can tie up the CPU until it completes. Even a wait of zero ms will allow the parallelism.