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.
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.
02-23-2021 12:41 PM
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
Solved! Go to Solution.
02-23-2021 01:19 PM
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!
02-23-2021 01:32 PM
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.
02-23-2021 02:18 PM - edited 02-23-2021 02:19 PM
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 )
02-23-2021 04:22 PM
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
02-23-2021 05:13 PM
@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.
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.
can go to this
The other issue is multiple
You don't need all those local variables you can do the following:
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
02-23-2021 06:57 PM
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.
02-24-2021 10:04 AM
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)
02-24-2021 10:28 AM
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.
02-24-2021 11:18 AM - edited 02-24-2021 11:18 AM
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
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 )