From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is an efficient way to separate this code?

All the code in this VI is currently controlled by a variable time control. What I want to do is break this while loop into two different sections, but the code still be dependent.

  • The area in the red circle needs to be under a variable time control for data logging purposes.
  • The area in the blue circle needs to be on a 100millisecond interval which can be a constant.I'll use an array to display the 100millisecond data, but it does not need to be data logged "for real-time view"

What is an efficient way to achieve this?

Seperatetimedelays.PNG

Download All
0 Kudos
Message 1 of 3
(2,454 Views)

Put red circle in case structure driven by Elapsed Time express VI.  Get rid of the wait timer in that circle.

 

In false case, just wire the array through unmodified.

Message 2 of 3
(2,440 Views)

You make the upper section as a subvi, with the shift register inside it. 

You then run that part only when you want to update the table. There is an input  - iteration that you can use connecto the iteration of the main loop i, so in the first iteration, it will start the array and then every time you want it to run, it will update the table. 

If you want that part of the code to run in a different rate as the main loop, you can then implement other mechanisms to make it run at the rate you specify. 

There is one point to consider, the datalogging part may use too much memory if you make it auto growth. You can define a time size for string array, or keep ading the data log data into a file, adding just the latest data, instead of saving the whole table every time. 

 

 

 

RKO
0 Kudos
Message 3 of 3
(2,425 Views)