LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Run Out Issue

Solved!
Go to solution

Why flatten the array? Why not simply Write to spreadsheet file? I guess the result is about the same, just a couple of unnessecary blocks.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 21 of 27
(682 Views)

@Yamaeda wrote:

Why flatten the array? Why not simply Write to spreadsheet file? I guess the result is about the same, just a couple of unnessecary blocks.


Well, the flattened data is binary and thus much more efficient and predictable. However, I just noticed that the first write operation is set to "Convert EOL" (look at the icon!), which of course throws sand in the gears and will corrupt the binary data almost guaranteed! But yes, the 2D array could be written using the binary file IO's which include the flatten step internally. The current code is definitely flawed!

0 Kudos
Message 22 of 27
(680 Views)

To sum up the issues:

 

1) absolutely all the code shown in the image can be put inside the false case of the structure without any runtime behaviour change, except maybe a possible side effect from calling the data retrieval VI.

 

2) As Altenbach already pointed out, the Flatten to String together with a write to Text File AND enabled convert EOL is definitely going to corrupt the binary data in the file. So the data may be more compact but totally useless to read back afterwards. Either save the data as spreadsheet file or use directly a Write Binary File which does the Flatten to Binary String internally too. With the sizes you mention, I don't think the saving in disk space is significant unless your application writes such files every second or faster.

Rolf Kalbermatter
My Blog
0 Kudos
Message 23 of 27
(659 Views)

@altenbach wrote:

@Yamaeda wrote:

Why flatten the array? Why not simply Write to spreadsheet file? I guess the result is about the same, just a couple of unnessecary blocks.


Well, the flattened data is binary and thus much more efficient and predictable. However, I just noticed that the first write operation is set to "Convert EOL" (look at the icon!), which of course throws sand in the gears and will corrupt the binary data almost guaranteed! But yes, the 2D array could be written using the binary file IO's which include the flatten step internally. The current code is definitely flawed!


I haven't looked into the Write spreadsheet array, but assumed it used some sort of Flatten inside. If so, it's a slight Rube to do the job yourself. 🙂 In this case it also introduces an error, as you point out.

/Y

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

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 24 of 27
(633 Views)

Write spreadsheet does formatting, not flattening. Big difference. To do it yourself, you would use "array to spreadsheet string".

0 Kudos
Message 25 of 27
(613 Views)

@dhaugen92 wrote:

...Do you get the same problem if you just write the file and don't zip it up.


oooh. I DID confuse it with 'replace array subset'...

Let me switch that and see what happens.

Haven't tried not zipping it... interesting proposal. If the first thing doesn't work, I'll try that too.


So... the answer is?

 

Curious,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 26 of 27
(577 Views)

once I replaced the subset instead of inserting

the problem went away.

i monitored the index values for row and column in 'array size' function

it was increasing before

with using 'replace array subset', it no longer is.

 

THAN YOU ALL

Dan Haugen
Certified LabVIEW Developer
CLD Instructor
Message 27 of 27
(570 Views)