From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Assign Filenames of Images

Solved!
Go to solution

Hi,

 

I am acquiring images every few nanoseconds from a camera through LabVIEW.  

 

What is the best way to make the camera wait 10 nanoseconds and then snap an image using IMAQ (I already have the image snapping VI), and then download that image as a BMP file with a certain filename (e.g. pic1.bmp) into a given folder?

 

I don't want the camera to have to wait for the computer to download the image because that may result in a delay.  Any help? 

 

I was thinking something like in a for-loop I have the snap and wait VIs, and the acquired image goes into an array, which is then saved after all images are snapped.  But how would I name each pic in the array the filename I want?

0 Kudos
Message 1 of 20
(3,314 Views)

@Max_2013 wrote:

I was thinking something like in a for-loop I have the snap and wait VIs, and the acquired image goes into an array, which is then saved after all images are snapped.  But how would I name each pic in the array the filename I want?


Once you have an array of images, you can run it through an 'Auto index enabled' For loop and can name it logically... What is the issue you foreseeing in that.

 

You can also have two loops running parallel and Image acquisition loop can transfer the image data to low priority second loop.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 2 of 20
(3,307 Views)

What is the VI I need to use to name the files logically with auto index enabled?

0 Kudos
Message 3 of 20
(3,297 Views)

You dont need any VI to name the files logically, but you need to write a small code to:

1. Create valid and logical name.

2. Save the Image data from array one by one to specified location.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 4 of 20
(3,285 Views)

Hmm, I am having trouble getting the elements out of the array of IMAQ images I built.  When I use the index array function, I cannot connect the 1D array of IMAQ images... 😞

 

For some reason the datatypes don't match.

 

Any help?

0 Kudos
Message 5 of 20
(3,239 Views)

You need to disable auto-indexing of the array tunnel entering the for loop containing the 'index array' function to use that function.

 

Better solution is to keep auto-indexing and lose the 'index array' function (aut-index does the same) and you don't need to wire the 'N' input of the for loop when aut-indexing (loop will run as many times as there are elements in the array).

Message 6 of 20
(3,234 Views)

I cannot find where this auto indexing option is for some reason 😕

 

I implemented your better solution; however, no images are being saved in the specified location.  Furthermore, how do I write code in labview to create specific filenames for each image like pic1.bmp, pic2.bmp, etc.  I get what you're saying about auto indexing, but I am unsure how to physically do it.

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

Anybody?  Really urgent.

0 Kudos
Message 8 of 20
(3,203 Views)

Something Like this.  (I'm assuming that folder should be created in runtime in ur desktop 😄  but u can use fixed path instead)

 

 

How long ur application will be used? (Hours,days,weeks?)

 

  If that answer be a long time or need to work with "big dataset"...I Recommend yourself to pay attention in memory usage in ur attached VI, cause build array inside in for loop (really bad idea) forces LabVIEW to reallocate memory in every iteration of the loop.Therefore, U need to decouple that processes (QMH or P/C Architecture) and preallocate that image array with fixed size and work "in place".

 

Message 9 of 20
(3,197 Views)

This is quite odd, 

 

Everything appears to work correctly, but when I check the folder for the downloaded BMP files, there is nothing.  Could it be that somehow the flat sequence structure is messing up the storage of the pictures into an array?  

I do not need to image for a long time (minutes), so I am not worried about overloading on memory.

 

I am not very experience with LabVIEW though, how would I "decouple that processes (QMH or P/C Architecture) and preallocate that image array with fixed size and work 'in place'."

0 Kudos
Message 10 of 20
(3,175 Views)