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
(185 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
(180 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
(168 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
(164 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
(141 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
(138 Views)

oh, sorry I will try to more clear 

 

so I have this Vi, that I called Morgan, so I am currently using as a "saving report", if you see, when he is  called it save a pdf and a image of the Vi in the same paste. 

So what is it for, the Idea it is that I have a Testes de tração, I gonna send a image just for the contex 

 

MarcusP_0-1728580772682.png

So, what happens is that I need this VI (Morgan) to save the report as a PDF. I'll also add the Morgan file I’m using and explain how I use it.

First, I run the tensile test and collect a lot of data from a simple test. Then, I press the "+1" button, which triggers the case structure, closing the Morgan VI. This makes it save the collected data as a PDF, and the test continues. I repeat this process a few times, and then I press Stop, which triggers the case structure in the Morgan VI again, displaying an empty array and saving the PDF again with the name of the test O.S.

So then, what happens is that, I need this .vi(morgan) to save this report as a pdf

So what happend is that first, I use that "teste de tração", and collet a lot of data from a simple teste, and then I press the +1, that make the case structure, shut this (morgan) vi, so then I make it save the data that it coleted, as a pdf, and then the teste continue, so i make it happens sometimes, and then a Press Stop, that trigges the case structure in the morgan.vi, that display the empty array and then save again the pdf in the name of the O.S
( I was in a circle to explain, but i think this was clear, or not( sorry) 

So just to be clear, for now I think I solve the problem, so thank you a lot

0 Kudos
Message 17 of 17
(128 Views)