LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving multiple IMAQdx images

Solved!
Go to solution

Hi, I wanted to ask for help in implementing my program. I want to save the image from my camera when I click on the button, so that I can save the image, but when I save it again, it will be replaced with the current one. How do I create a new name with the current time name?

(For example: Image_12:30, Image_12:35..)

2) Is there a way to capture video from a camera and save it to a file not as an image, but as a video?

3) Is there a way to record the entire virtual instrument? (For example: A video showing the inodes, camera, and other interface elements)

Download All
0 Kudos
Message 1 of 6
(183 Views)
Solution
Accepted by topic author SeraphimSeth

Hi Seth,

 


@SeraphimSeth wrote:

How do I create a new name with the current time name?

(For example: Image_12:30, Image_12:35..)


Like this:

Read the help for format codes to learn about the possible options!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(128 Views)

Hello,

1. GerdW already showed you a more scalable way (especially since you can also add fractional seconds) to name your file, but even in your code you could connect True to "want seconds?" (EDIT: to "Get Date/Time String") in your code :).

2. Yes, as .AVI file. Check this example: C:\Program Files\National Instruments\LabVIEW <version>\examples\Vision\Files\Read AVI File.vi. You'll figure out how to write frames to AVI based on that.

3. Would overlays on the image work for you? Check this example on how to handle overlays, just remember you'd likely need to use IMAQ Merge Overlay function before writing to a file. C:\Program Files\National Instruments\LabVIEW <version>\examples\Vision\Contour Analysis\Contour Defect Inspection.vi. Of course there is IMAQ Overlay Text, so you can add info you need in the image.

Hope that helps!

0 Kudos
Message 3 of 6
(115 Views)

Thanks for the advice and help from "GerdW" and "Zieleslaw"

 

I have previously used this method, it is also somewhat working, but I think your suggestions are more correct in terms of coding.

 

coding.pngresult.png

 

 

 

I am self-taught and therefore

I want to learn how to code correctly.

 

Thanks again!

0 Kudos
Message 4 of 6
(51 Views)

Hi Seraphim,

 


@SeraphimSeth wrote:

I have previously used this method, it is also somewhat working, but I think your suggestions are more correct in terms of coding.


Well, my method definitely looks more simple (with just one FormatIntoString) than your code with 4 functions and lots of string constants…

 

Recommendation: use a filename scheme that allows for simple file sorting! That's why I suggested a naming scheme like %H%M%S: it results in the same file order when you sort by name or by file creation date…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 6
(43 Views)

I was able to display the information on the video and have this information saved via AVI along with the image.(I did a simple test on displaying the number 100 to understand how it works)

Снимок экрана 2025-02-13 110257.pngСнимок экрана 2025-02-13 110919.png

 

But for my project, I would like the information and the video to be displayed separately when watching the video. (This will be much more convenient, since I will receive information from sensors (current, power, voltage, etc.) this is a fairly large amount of information that will overlap the video, which is not good. 

 

For example: (The video is saved AVI - the user views both the video and the information from LabVIEW)

Снимок экрана 2025-02-13 111831.png

0 Kudos
Message 6 of 6
(3 Views)