LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow down of motion with data acquistion.

I have two AKD driven actuators driven by NI-9045 Chassis controller and MODBUS ethernet communication.  There are two Labview VIs, one for sending the commands to AKD and the other for data acquisition from load and displacement sensors. Signals from load and displacement sensors are acquired by Ni-9045 and a separate VI. The actuators are to move along a sinusoidal motion regime.  The physical performance slows down after 50-80 cycles and the sinusoids become irregular in shape and slow down and literally hang up. When I shut down the data acquisition VI, the sinusoids become normal and the system runs fine. The data is supposed to be saved in excel and a csv file. I suspect that it is either the write to spreadsheet or create tdms aspect of the code that is slowing things down. Global variables could be the less likely reason. The data acquisition VI is attached and a snip of the write to file part of the code is shown below.

 

May I ask any of the experts to have a look and provide some guidance please? Many thanks in advance.

 

oxsanj1_0-1692637930472.png

 

0 Kudos
Message 1 of 5
(627 Views)

Hi oxsanj,

 


@oxsanj1 wrote:

I suspect that it is either the write to spreadsheet or create tdms aspect of the code that is slowing things down. Global variables could be the less likely reason. The data acquisition VI is attached and a snip of the write to file part of the code is shown below.


What about all those charts and graphs that need to plot large amounts of data?

What about evergrowing arrays in shift registers?

What about all those array to elements to arrays to elements dancing?

What about array handling in PtByPt functions?

 

When you run your code on a RT target then you should implement RT-like coding style!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(605 Views)

Great points GerdW. Thank you. Very helpful.  It is a huge amount of data. I had overlooked the ever growing arrays, charts and graphs.

 

Being a relative novice I guess I will need another year or 2 of Labview practice before I will overcome these issues and make it efficient. 

-charts and graphs that need to plot large amounts of data

-ever-growing arrays in shift registers 

-array to elements to arrays to elements dancing

-array handling in PtByPt functions

 

 

0 Kudos
Message 3 of 5
(592 Views)

Hi oxsanj,

 


@oxsanj1 wrote:

I suspect that it is either the write to spreadsheet or create tdms aspect of the code that is slowing things down.


Yesterday I forgot to mention: THINK DATAFLOW!

Your TDMS file saving is only executed once AFTER the loop, so it CANNOT influence how fast the loop iterates!

 

That's why I brought up all those other items that need to be improved inside the main loop…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(542 Views)

Thank you GerdW. I am grateful. I will focus on the items inside the main loop.

0 Kudos
Message 5 of 5
(533 Views)