LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tracking bottlenecks

Good afternoon,

 

We're hitting that point in porgramming where it's not the logic but the structure that's giving us fits.  We have a moderately complex vi that runs on a MyRIO, collecting data from three IMUs via I2c and writing the information out to a memory stick.  However, the program collects at about 80Hz, and we need it much much faster.

 

i2c communicates at 400kHz, and going straight of the number of bits being transferred back and forth, we should be able to collect at around 500 Hz or so.  So, there's something (if not a lot) in the program that is taking up valuable programming time.. I'm wondering if there is a way to do a time study on the program to identify where the significant slowdowns are, and if not, some guidance on what the likely culprits could be

 

Right now, some of my thoughts include:

  • delays from writing data out via TDMS on the memory stick
  • delays from using standard subvis for i2c.  We have to read two separate i2c devices on the same bus, and right now we're doing this serially by calling on the i2c read twice, each time with the new slave id.
  • delays from calculating a chart (which is dynamically generated)
  • delays from misunderstanding the nature of the MXP connectors and thinking they run in a true parallel fashion.
  • delays from using sequence/while/case structures to try and visually compress the program
  • delays from using subvis instead of leaving the code in the main program

The program's a bit large and ungainly to post, but I thought this would be a good way to start to prioritize the investigation.

 

Thanks!

 

 

0 Kudos
Message 1 of 4
(2,372 Views)

First, start with the DETT.  this tool is designed to help you isolate those bottlenecks.

 

Next look into the latency timer settings of your USB devices (Assuming the memory stick has a FTDI chipset) Look here

 

Lastly, consider the USB chipset of the memory sticks....

 

 

And, would a RAID array be more appropiate?


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 4
(2,358 Views)
Hi. I see you are on myrio. Jeff missed this I think. You can use the real time execution trace tool on rt targets. This will help to get execution timings. Streaming to usb is very dependent I the make and model of the usb stick, and the formatting including sector size can make a difference too. I doibt this is the problem at your rate though.
Michael
Message 3 of 4
(2,323 Views)

I also think the Real-Time Execution Trace Toolkit will be the best resource to begin exploring the timing bottlenecks you are seeing. It will function slightly differently on the myRIO target than NI's other cRIO products, but it will still allow you to see how much time is being spent in which VIs. This along with your modular coding should allow you to trace which VIs and tasks are slowing down the program.

0 Kudos
Message 4 of 4
(2,270 Views)