09-30-2019 12:36 PM
I want to collect and display power consumption data by ModbusTCP protocol but, When allowing LabVIEW to collect data for a while, LabVIEW will collect data at a slower pace with the same delay time.
(I try to fix this issue by change labview 32bit to labview 64bit and try to use all timing node to fix issue but it can not solve)
System
Processor : Intel Xeon CPU E5-2630v3 2.40GHz
Ram: 32 GB
System Type: 64 bit (Windows 10 Pro)
Please help me
Best Regard.
Solved! Go to Solution.
09-30-2019 01:08 PM
The first glaring thing I see is the Write To Measurement File. How do you have it configured? That thing will get SLOW depending on many factors. But the biggest issue is that it opens and closes the file each iteration of your loop. I am sure this is not desired, especially at 10ms rates. Generally, I would suggest a Producer/Consumer type of setup, which moves your logging to be in a separate loop. Also, that consumer loop should open the file once before the loop and close it after the loop. Writing in the middle can then happen at a rate that should be able to keep up with the data rate.
I also see a property node that is repeatedly written to with what appears to be a constant. That should be moved to outside of the loop since writing to property nodes are really slow (force a thread swap to the UI loop).
09-30-2019 01:21 PM
Without the actual code (not an image), it's difficult to say. I suspect it has something to do with the Write to Measurement File. After a large amount of data has been written to the file, I would think the process of opening, traversing to end of file, writing and closing the file in every loop iteration will take progressively longer. Would it take 40sec to do this? That seems excessive but I guess it depends on the amount of data in the file. Look into a producer/consumer architecture that will offload the file operations into a separate process.
09-30-2019 04:16 PM - edited 09-30-2019 04:18 PM
As others have said, we cannot inspect or debug pictures.
Still, the picture tells us that your code is far from optimized or even reasonable.
so please attach your VI. We can test using a simulated array instead of the instrument IO.
09-30-2019 10:42 PM
10-01-2019 07:07 AM
Stop logging to an Excel file. I would recommend a TDMS (which you should have a plugin to open with Excel) or a tab delimited text file (which you can still open with Excel).
I also question your data conversion. You have an array of U16 from the data registers and then you type cast to SGL values. The problem is that SGL uses 32 bits. So I don't think the conversions are working the way you think and you may need to do some math to get the values you actually want.