LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving an 2D array to a text file

Hi,

 

I have written a program in labview which does some particle analysis on an image. I have written a some C and compliled it as a dll to save a 2D array as a text file. (I used this this tutorial: http://decibel.ni.com/content/docs/DOC-1690).

 

This works fine until I transfer the program to another computer (it seems to want some other dll file associated with visual studio, which this other PC doesn't have).

 

I there an easier why to do this without using a dll file? I have attached the .vi file and the c code i was using. The .vi uses a black bmp image with white circles on it.

 

Thanks,

 

Jack

Download All
0 Kudos
Message 1 of 7
(20,694 Views)

Hi Jack,

 

Use the LabVIEW File I/O functions to write the data to file. From what I see in your C code you write the data in text format. "Format into File" is very similar to the C fprintf function you're using.

Check the LabVIEW help/examples for more information.

 

Hope this helps,

Daniel

 

0 Kudos
Message 2 of 7
(20,691 Views)

Ok thanks, I'll have a play. One of the reasons I did it in C in the first place was because I couldn't work out how to extract individual elements of the array and print them to the file individually (so I had some control over the formatting).

 

Cheers,

 

Jack

0 Kudos
Message 3 of 7
(20,688 Views)

Well then you should learn some LabVIEW basics first Smiley Happy

Good luck!

 

Daniel

 

0 Kudos
Message 4 of 7
(20,685 Views)

bluefocs wrote:

... I couldn't work out how to extract individual elements of the array and print them to the file individually


You could use the Index Array function :

Message Edited by Cory K on 02-04-2009 01:04 PM
Cory K
0 Kudos
Message 5 of 7
(20,661 Views)

What are the names of the 2nd and 3rd yollowish blocks? Can't find them at the moment.

 

0 Kudos
Message 6 of 7
(20,635 Views)

Hi bluefocs,

 

these are "build array" and "array to spreadsheet string" - pretty basic Smiley Wink

 

You really should learn the basics of LabView!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(20,626 Views)