LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Saving Multiple Array Values Without Overwriting in LabVIEW

Solved!
Go to solution

uhh Hello,

 

So I was trying to figure this out on my own, but I ran into an issue. I’ve managed to save and retrieve some points, and it works perfectly through a loop, but now I’ve hit a roadblock. Remember that I mentioned I would use this as a .vi, and now that I’m trying to use it, the loop either keeps running indefinitely or it just kills the process.

The problem is that every time I need to exit the loop to process the next value, I lose the previous one. Everything works fine while the loop is running, but when I stop the loop (by hitting the stop button), the VI stops completely, and I can’t save the previous record.

I’m not sure how to handle this, so I can keep the values I’ve already saved and still process new ones without having to restart the entire VI.

0 Kudos
Message 11 of 17
(288 Views)

@MarcusP. wrote:

So I was trying to figure this out on my own, but I ran into an issue. I’ve managed to save and retrieve some points, and it works perfectly through a loop, but now I’ve hit a roadblock. Remember that I mentioned I would use this as a .vi, and now that I’m trying to use it, the loop either keeps running indefinitely or it just kills the process.

The problem is that every time I need to exit the loop to process the next value, I lose the previous one. Everything works fine while the loop is running, but when I stop the loop (by hitting the stop button), the VI stops completely, and I can’t save the previous record.

I’m not sure how to handle this, so I can keep the values I’ve already saved and still process new ones without having to restart the entire VI.


 

If you have a problem with "corrected" code, you need to show us the code. (all parts: Caller, SubVI, etc.)

 

I have the feeling that your shift register is not anchored in the right outermost loop. Why would you need to "exit the loop" (sic)? The toplevel loop should only exit once the program is done. if this is handled in a subVI, you need to implement a proper action engine and leave the shift register unwired.

 

While dataflow is a very simple concept, you seem to have problems understanding the logic. Have you done any beginner tutorials? Once it clicks, you'll be fine!

0 Kudos
Message 12 of 17
(283 Views)

Make sure you keep the file reference open so it continues to write instead of starting from the beginning each time.

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 13 of 17
(271 Views)

@Yamaeda wrote:

Make sure you keep the file reference open so it continues to write instead of starting from the beginning each time.


I don't understand how a "file reference" is part of this discussion, but maybe I misunderstand your point.

0 Kudos
Message 14 of 17
(267 Views)

Aaah, I understand now.

 

So, I did this: I used an "if" with a 0 array. What happens is, when I want to make a record and then another one after that, I have one block of "+1", and when I use it, it simply adds the value and keeps it there. I also added a "stop" button, and when I press it, it triggers the true case of a conditional structure, which then displays a 0 array to clear the data.

0 Kudos
Message 15 of 17
(244 Views)

@MarcusP. wrote:

Aaah, I understand now.

So, I did this: I used an "if" with a 0 array. What happens is, when I want to make a record and then another one after that, I have one block of "+1", and when I use it, it simply adds the value and keeps it there. I also added a "stop" button, and when I press it, it triggers the true case of a conditional structure, which then displays a 0 array to clear the data.


But we don't understand without seeing the actual VI.

 

  • What is "this"?
  • what is an "if"?
  • What is a "0 array"? (an array of zeroes? an empty array?)
  • Where is "there"?
  • What is a "record" in this context? 
  • What is "conditional structure". I assume a "case structure", right.
  • A display has nothing to do with clearing data.
0 Kudos
Message 16 of 17
(241 Views)