06-05-2018 08:45 PM
I have two parallel while loop for DAQ.
While loop 1 for reading SR830 Lock-In with "FAST2" -128Hz method through GPIB.
While loop 2 for reading current from a device through TCP/IP.
Only while loop 1 running, reading SR830 speed is 128 points per second.
Only while loop 2 running, reading current speed is around 200 points per second.
When these two while loops run parallel, while loop 1 keeps the same reading speed (128p/s), while loop 2 gets slow er and slower (from ~40p/s down to 12p/s after 1000s continuously running).
I tried having 1ms delay or have no delay in both loops, almost the same results. How to increase the while loop 2 speed up to 100p/s at least when parallel running?
LV2013sp1, Win7 pro 32bit
WT
Solved! Go to Solution.
06-06-2018 12:01 AM
Can you please post some code? It might just be some small detail that is not contained in your description.
What is done with the data once it is read?
06-06-2018 04:16 AM - edited 06-06-2018 04:17 AM
And when you post code, post your VI, not a "picture" of it. We can't edit, inspect, test, or modify a picture easily (unless you know how to create a LabVIEW Snippet ...). Note that if you have several VIs, compress the folder that includes them (and the LabVIEW Project file, which I hope you are using) and attach the resulting .zip file.
Bob Schor
06-06-2018 08:26 AM
Please unzip the files, and open the VI file:
E:\2 while loop for post\E\MFHF_Acquisition\MFHF Acquisition - ver 0.7d-temp.vi
Thanks.
LV2013
WT
06-06-2018 12:24 PM
Here are some (urgent!) Code Suggestions:
Is Loop 2 (the TCP/IP Loop) the one at the top of your code, with VIs Open Device and Get Current? You said that, by itself, it runs at 200 Hz, but if Loop 1 is also running, it is much slower. It sounds as though Loop 1 is "interfering" with the functioning of Loop 2. I notice in Loop 1 you have a Read of 1000 characters. This is standard "Good Practice" for VISA Reads where you expect a short string of unknown length + a termination character -- is this how your GPIB is configured? Could it be that it is "stalling" trying to read 1000 characters and is taking too many cycles away from the TCP/IP loop?
Bob Schor
06-07-2018 09:02 AM
Thanks for your points.
Today I have found some clues. If I disable the XY graph (leaving the two charts work), the while loop 2 keeps reading speed around 190p/s.
I don't know why the XY graph bothers while loop 2.
LV2013sp1
WT
06-07-2018 09:09 AM
The Call Library node in Get Current is set to run in UI thread so it'll interfere with redrawing.
/Y
06-07-2018 10:12 AM
Thanks for your comments!
I checked the configuration of the Call Library node in Get Current and it was "Run any thread". How can I solve this problem?
LV2013sp1
WT
06-07-2018 10:34 AM
If that is true (???) then you should make sure the calling VI is not marked to run in the UI thread
AND
Ensure there are no property nodes involved in the second loop.
Property nodes often run in the UI thread.
Ben
06-07-2018 10:45 AM - edited 06-07-2018 10:47 AM
How to check "the calling VI is not marked to run in the UI thread"?
As for property nodes, I checked, no one are involved in the second loop.
Thanks.
LV2013sp1
WT