09-04-2021 03:51 PM
After a save event, my VI has a while loop run that acquires data in an array, writes the data to a file (~5 MB), and then repeats until I stop the VI. However, labview runs out of memory. I think it must be saving all of the data rather than writing over the data each iteration. Looking at the screenshot, could someone confirm (or tell me I'm wrong) and tell me how to resolve the issue?
09-04-2021 08:26 PM
You have an endless loop in your event case. This tells me you are trying to use the Abort button to stop your VI. DO NOT DO THIS. You need a clean way to stop your VI so that things are properly cleaned up instead of literally crashing it.
As far as your memory issue, you have some subVIs in there that we need to be able to see. I don't see anything in the image you shared that would give me a reason to fear a memory issue.
09-07-2021 12:42 PM
Sounds great, thank you. I will add a way to stop the VI properly.
I have attached a screenshot that shows the memory issue error. The error says the reason is "LabVIEW: (Hex 0x 2) Memory is full // No listeners on the GPIB. In addition, I am attaching the subVIs and the hardware's manual that describes the subVIs. First is acquire to ram, which is my data acquisition from the board. Next is boardtopcxfer, which sends data from the board to the PC. Please let me know if I can provide additional information to root out the problem.
I really appreciate your help! I've struggled with labview a good bit over the last couple years, but I'm still not very competent with it.
09-07-2021 12:52 PM
@Graham_GT wrote:
I think it must be saving all of the data rather than writing over the data each iteration. Looking at the screenshot, could someone confirm (or tell me I'm wrong) and tell me how to resolve the issue?
That is easy enough to check if you open your Write to Measurement File Express VI and look at the settings you've chosen.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
09-08-2021 08:29 AM
Thank you. I tried several combinations of settings within the write to measurement express VI, but I didn't stumble upon any that 1) created a new file each acquisitions and 2) didn't give me a memory issue. Also, I thought setting "reset" to 1 on the outside of the VI was supposed to tell it to start a new file. Do you know which settings make sense for actually achieving my aims (new file each time, no memory issues)?
Interestingly, I tried appending new data to the current file, and it didn't give me any memory errors. However, on the processing side, I have to pull in an increasingly large amount of data each time and select just the new data, so I think that generating new files for new acquisitions would be the easiest approach.
09-08-2021 08:54 AM
It can be a false error. Error 2 is used for Out of memory, but if something else (like invalid file name) generates error 2 you'll get the wrong error text. So double check which function generates the error.
09-08-2021 09:20 AM
@Graham_GT wrote:
Thank you. I tried several combinations of settings within the write to measurement express VI, but I didn't stumble upon any that 1) created a new file each acquisitions and 2) didn't give me a memory issue. Also, I thought setting "reset" to 1 on the outside of the VI was supposed to tell it to start a new file. Do you know which settings make sense for actually achieving my aims (new file each time, no memory issues)?
For making a new file each time, it should just be a matter of wiring TRUE to the Reset terminal and selecting "Use next available filename" in the settings. Also, just because the error said the VI ran out of memory at the express VI, doesn't mean the settings of the express VI are to blame.
Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.
09-10-2021 03:48 PM
Thank you, Yamaeda and Redhawk.
Yamaeda: Write to measurement file seems to be the function that generates the error. I'm not sure how to tell if it's a false error not related to memory, though.
Redhawk: That makes sense. For some reason, I had it "write to multiple files" even though that doesn't make sense. I used your settings and changed the file type from tdms to a text file, and I haven't gotten a problem yet after acquiring > 10 GB of data. Thank you. I'm hoping it is fixed. The challenge is sometimes I re-run the same VI without making any changes and get a different result. For example, sometimes after acquiring the first batch of data, labview times out without going to the second iteration.
09-13-2021 02:37 AM
@Graham_GT wrote:Yamaeda: Write to measurement file seems to be the function that generates the error. I'm not sure how to tell if it's a false error not related to memory, though.
It should be easy enough to copy that function and the incoming file path to a separate trial-vi. I guess there's some invalid character or an empty path at play. 🙂
09-13-2021 07:04 AM
Excellent, thank you. I won't be able to check for a few days, but I'll post an update as soon as I can