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: 

IMAQdx frame snap

Solved!
Go to solution

Hi NI community,

 

Question 1:

I want a VI that takes an image from the camera when I hit the boolean and keeps it for later use. When I run my VI it doesn't show an image, when I run it in highlight execution mode it does work fine. I also attached the VI if you want to try it out.

 

IMAQdx.JPG

 

Question 2:

At the end I want a VI that captures 5 different images using 5 different booleans. I was looking for a structure with 6 cases (doing nothing + 5 capture image cases)  when I hit one of the booleans. I couldn't find one (event structure and conditional disable structure seems intresting, but I couldn't figure it out how to use them if it is even possible). So my simple solution was to copy the case structure 5 times. That would probably work, but doesn't seem like a clean solution (what if I want to capture 30 images).

 

 

Kind regards

Ruts

0 Kudos
Message 1 of 8
(2,926 Views)
Solution
Accepted by topic author RutsT

Hello Ruts,

 

I made a small adjustment to your code.
It's not yet optimal performance wise, but it should give you at least an output.

Please note that you should have some wait functionality in your while loop and try to keep your initialization code outside of the loop (whenever possible).

 

Can you test it and let me know if problem 1 is resolved?

 

Concerning question 2:
- Do you have any previous experience with LabVIEW?
If yes, what have you already tried?

- Have you followed any courses (Core 1, Core 2, ...) ?

  Do you have access to the online training materials?
  If you do, then one good place to start to learn about event structures and other things is the following page:
https://lumen.ni.com/nicif/US/LMS_LOGIN/content.xhtml?du=http%3A%2F%2Fsine.ni.com%3A80%2Fmyni%2Fself...

- Are the image from the same camera?
  How should they be shown to the user?

- Side-question:
  For what will this acquisition in the end be used?

Probably the easiest way to get started would be some kind of event driven state machine that acquires different images.

 

 

The attached Code is provided As Is.  It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments.  You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at:

http://ni.com/samplecodelicense

 

 

 

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Message 2 of 8
(2,880 Views)

Hi ThiCop,

 

Sorry for my late response. Thank you for solving my problem.

 

About question 2:

- Do you have any previous experience with LabVIEW?
I have little experience with LabVIEW. I'm a student who had some basic lessons about LabVIEW. But now I have big project where I have to use LabVIEW all the time. The guy who gave me this assignment knows how far my knowledge about LabVIEW goes and he decided to put me on this to learn to program in LabVIEW by myself.

 

- Have you followed any courses (Core 1, Core 2, ...) ?

 I have no access to these courses

 

- Are the image from the same camera?

Yes, the images come from the same camera.


  How should they be shown to the user?

How they are shown ain't that important. My plan was to show the continues image from the camera on one screen in the front panel and when the user hits a boolean it should capture the current image and keep it for further use (also every captured image shown in front panel).

 

- Side-question:
  For what will this acquisition in the end be used?

I'm currently working on a 3D laser scanner and I need to calibrate my camera to get metric information out of my images. In order to do that I need different images from a calibration grid. After all the problems I currently had with making my own calibration VI I did decide to calibrate my camera with other software (NI calibration guide or Matlab calibration toolkit). I want to make my installation work with these methods and maybe if I got time left I can come back and try to calibrate my camera with my own VI because this looks more user friendly if everything is intergrated in one VI.

 

Kind regards

Ruts

0 Kudos
Message 3 of 8
(2,852 Views)

Hello RutsT,

 

This last sentence is not completely clear to me:
"My plan was to show the continues image from the camera on one screen in the front panel and when the user hits a boolean it should capture the current image and keep it for further use (also every captured image shown in front panel)."

Can you maybe draw the Front Panel of how this could look like?
If you can do this and explain via the Front Panel, what should show up where, then I can assist you along the way.

Have you ever worked with event structures and/or parallel loops?
Which basic lessons did you already follow?
Have you already went through these ones:
http://www.ni.com/academic/students/learn-labview/

In which year of your studies are you currently?
Are you using the Student Install option or are you using another specific serial number (don't post it over here)?

There are several training options online, so depending on which ones you have already followed, I could provide you with new/different material.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 4 of 8
(2,833 Views)

Hi ThiCop

 

Here's my front panel:

FrontPanel.JPG

 

In the left image display I want to show my continues image flow (like a film) so I can see which image my camera currently is taking. When I hit one of the booleans at the right I want to take a photo and store it at its respective image display. When all images are captured I want to use them for camera calibration. Is this clear to you?

 

I have never worked with event structures or parallel loops. I'm familiar with the while loop, for loop, case structure, formula node and I think I know the working of both sequence structures.

 

The basic lessons I already follow kind of match with the link of you. The rest of my (small) knowledge comes from working on projects and find things out by myself.

 

I'm currently in the last year (3th) of my bachelor studies (20 years).

I use student install.

 

Regards

Ruts

0 Kudos
Message 5 of 8
(2,829 Views)

Hello RutsT,

 

I have made a very limited fixed functionality example to give you an idea on how you could do this.

 

Some important remarks:
- I am grabbing images instead of snapping, which I suppose is ok for you.

- At the other side I use a cluster to combine my 5 seperate "get image buttons":
- In my "event handler" I just use a timeout to continuously acquire.
- When I press a button I just handle it in the cluster related event case.

Please not that this not really the best approach.
I used the "simple event handler" deisgn pattern, because this seems like the one that will be the easiest understandable (based on your background).
I would strongly suggest that you do read into some other Design Patterns.

 

This page is a good starting point:;
https://decibel.ni.com/content/docs/DOC-32964

 

In your case the QSM-PC (Queued State Machine - Producer Consumer) might prove to be very useful and more easily scalable. (this of course depends on your interpretation of scalable)

 

The attached Code is provided As Is.  It has not been tested or validated as a product, for use in a deployed application or system, or for use in hazardous environments.  You assume all risks for use of the Code and use of the Code is subject to the Sample Code License Terms which can be found at:

http://ni.com/samplecodelicense

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
Message 6 of 8
(2,803 Views)

Thank you ThiCop for feeding me with this information. When I have got the time I will read it carefully.

 

I like to learn new things in LabVIEW because there are so many applications where I could use it. To bad they didn't teach me more, so I could program without asking something every hour on this forum. 

 

 

Kind regards

Ruts

0 Kudos
Message 7 of 8
(2,799 Views)

Hello,

 

If you have specific topics you would like to have some information about, then don't hesitate to ask.

 

I might be able to find the information more easily.

Kind Regards,
Thierry C - CLA, CTA - Senior R&D Engineer (Former Support Engineer) - National Instruments
If someone helped you, let them know. Mark as solved and/or give a kudo. 😉
0 Kudos
Message 8 of 8
(2,795 Views)