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: 

Cumulative data storage

Solved!
Go to solution

Hi,

 

I have an incremental increase between 'Min RPM' and 'Optimum RPM' called 'RPM for least drag', in which I use for a calculation that I wish to store in an array, 'Cushion pressure array'. I believe I have set it up in the right way however, instead of storing the data for each increment, it only stores the data for the final value in the incremental increase, 'Optimum RPM'. 

 

Any help would be appreciated. Thanks

Download All
0 Kudos
Message 1 of 11
(2,482 Views)

Hi novice,

 


@LabVIEWnovice99 wrote:

I believe I have set it up in the right way however, instead of storing the data for each increment, it only stores the data for the final value in the incremental increase, 'Optimum RPM'. 


Why do you "believe" instead of "knowing"?

You are kidding when you are attaching several images of a huge (aka too big) blockdiagram. When you want help then attach the VI!

Best regards,
GerdW


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

I 'believe' as the code doesn't work. I would 'know' if the code did work.

 

The reason I did not attach the '.VI' is because the code in question is part of a much larger code that includes spreadsheet data files and other inputs. The spreadsheet data files includes sensitive data that belongs to a company I am completing a project for.

 

 

0 Kudos
Message 3 of 11
(2,447 Views)

Hey Novice,

 

Posting this is very difficult for us to read and help you. Most of us work with projects like yours and can't post our whole code. Here's what we do.

 

Step 1: Make SubVI's

 Making a SubVI both helps you organize both your workspace, and your thoughts. It also allows you to test individual portions of your code (this is called unit testing) which is extremely useful for all involved.

 

Step 2: Reduce your whitespace

  Once you make a subVI, you won't need all that space in your block diagram, that way you can also better isolate the issue for us to help you with onto one image (or better yet, the sub VI)

 

Step 3: Provide simulated data around the issue. When I have a problem with big code, I make smaller code to replicate (or demonstrate the issue) and post it here with my question. Like with the example code I made for this question ( https://forums.ni.com/t5/LabVIEW/1D-array-to-Cluster-of-Clusters/m-p/4030861 ) 

Message 4 of 11
(2,433 Views)

Hi JScherer,

 

I have attached a small section of the .vi to the reply. Even without inputting data into the two arrays, the 'Stored array of output data' is filled with the final value of the incremental increase. I hope this is easier to follow.

 

Kind regards,

Novice

0 Kudos
Message 5 of 11
(2,402 Views)
Solution
Accepted by LabVIEWnovice99

@LabVIEWnovice99 wrote:

Hi JScherer,

 

I have attached a small section of the .vi to the reply. Even without inputting data into the two arrays, the 'Stored array of output data' is filled with the final value of the incremental increase. I hope this is easier to follow.

 

Kind regards,

Novice


Novice,

 

I suggest you look at the tutorials and diagram cleanup. Below is your diagram after cleanup.

 

Snap47.png

 

I do not understand what you are trying to do. For example, the following is way to convoluted, you can just use an "Initialize Array" function.

Snap48.png

can go to this

Snap49.png

The other issue is multiple

Snap50.png

You don't need all those local variables you can do the following:

Snap51.png

The other issue is you have is "Index" Value in the case structure. Once again I am not sure what you want to do, but the local variable "Index" may be an old value and not the current value that you calculated. You should use the terminal directly if you want/need the current value.

 

mcduff

Message 6 of 11
(2,396 Views)

Use Block Diagram Cleanup to get rid of the excessive white space.

 

One problem I see in your VI that might be causing you problems is that you are using a local variable of "Output Value" when you should be using the data out of the wire.  As a result, you have a race condition where in a given iteration of the while loop, you are probably using the old value rather than the new value.

Message 7 of 11
(2,386 Views)

I'm guessing you do a Write to file without keepin the reference open so it overwrites every time? (i can't open the code)

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 11
(2,365 Views)

My apologies about the 'block diagram clean-up' or lack of.

The index value is used to figure out which data value to add to the 'Stored array of output data'. I have changed it so that it is wired directly to the terminal. This has rectified the issue with the output array.

Thanks.

0 Kudos
Message 9 of 11
(2,361 Views)

It's fine, we all start new 🙂 . If your issue is resolved, be sure to accept as solution or Kudo any posts you've found helpful for you. Also, A few more tips:

1) Keep your wires tight, but still visible on your block diagram, and try to reduce wire crosses (especially of the same color) it makes reading and debugging much easier

JScherer_0-1614186842884.png

2) When saving vi's for the forum, assume most people are using 2-3 year old versions of labVIEW so save accordingly ( File -> Save for previous version )

 

Message 10 of 11
(2,352 Views)