LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW collect data slower

Solved!
Go to solution

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.

 

0 Kudos
Message 1 of 6
(2,148 Views)
Solution
Accepted by topic author Nitipatcs

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).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(2,132 Views)

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.

  • Is there a reason to write the table headers over and over?
  • What value is your chart history set? 
  • What's the purpose of the sequence structure?  It's doing nothing for you now.  Remove it.
aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 6
(2,114 Views)

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.

 

  • What's in the other case(s) of the small case structure in the lower right?
  • How big does the purple array (and the Table) get? Why are you using "insert into array" instead of "built array"?
  • So you get a small 1D array via modbus. Why would you need to convert it to at least 9 waveforms with one point each? (Where are all the array wires going that are leaving the image at the lower edge?
  • a dt=0 makes no sense!
  • What's the purpose of the sequence structure?
  • What is the size of the chart history buffers?
  • A simple wait is probably cleaner that a standalone time delay express VI
  • "Index array" is actually resizeable. You only need one instance.
  • We have no idea how "Write to measurements file" is configured. A picture of express VIs is way too opaque.
  • We cannot tell how you are converting an array of waveforms to dynamic data, especially since there is a coercion dot.
  • the table column headers can be written once before the loop (or even saved with the VI if they never change. No need to hammer them 100x per second with the same values.
  • ...

so please attach your VI. We can test using a simulated array instead of the instrument IO.

0 Kudos
Message 4 of 6
(2,057 Views)
I want to extract power consumption data from KUKA robot using power meter (PM5340). This is LabVIEW file for 64bit Thanks you.
0 Kudos
Message 5 of 6
(2,021 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(1,990 Views)