Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

use one software and grab at the same time

Hi everybody,

I have a little problem, I`m sure it is easy to resolve but I didn`t find the solution.

I have my first which use to open and close the gates..... But all the stuff is in a box, I can only check inside with one camera.

I would like to be able to see inside the box with my camera to be able to open or close the gate when I have to.

That`s my main software:

software.png

 

And I would like to add the code to acquire the images.

I know how to witte this code, but when i tried to add it. there are some problem. I can not see the picture pr use the motor.
Anyway I don`t know how to include the acquiring software.

Thanks you for yours solutions ^^

0 Kudos
Message 1 of 10
(4,966 Views)

Hello Gerday M,

 

Thanks for posting this question.

 

Unfortunately, it is not clear to me what you are exactly asking for.

 

Can you provide me with the following information?

  1. What type  of camera (model + interface) are you using?
  2. Does your current code work?
    Please provide the actual code instead of the image. At my side this image is to blurred to be able to get enough information from it.
    Please also describe clearly what your current code should be doing. (Just describing what you expect each block/piece of your code to do should be ok)
    Also let us know what is currently "going wrong" / "not working" with it?
  3. What is the "gate" you are referring to?
  4. How are you "closing" it?
    Which hardware are you using?
    How is this connected to the outside world?
  5. Did you start from a specific sample exercise?
  6. Have you followed any NI LabVIEW training?

 

Without a better understanding of your issues it will be not possible for me to help you.
 

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 2 of 10
(4,911 Views)

Hi,

Ok I will try to give you more information. I am not an expert so my apologize if sometimes it is not clear or complete.... 

 

1. The camera is one "Point grey flea 3 usb 3.0", For the interface, all my stuff have to do with LabVIEW, so I have to acquire the video with LabVIEW.
2. So how to explain clearly everything. Well with picture it is probably better.

First here you will see on what I am working.
stuff.png

My motor is connected with and other piece of metal (inside the white block). In this piece there are some holes. With the motor I am going to shift all this piece of metal and the holes will be just in front off the way. (There are some flies at the beginning, and when I open the gates, they are able to go in the Y.

Then, my motor is connected to Arduino and I connected Arduino with LabVIEW. (it exist one Package)

code.png

 

In this code, there is not only one motor like in the previous picture but two, because there are two side in the white plastic block.
It is a simple code, at the beginning the doors of the piece of metal are close, when I push on "open", the motor turn, pull the peice of metal and the gates are open. and when I push on "Close behind door" or "Close front door" I can choose which one I want to close. The motor turn in the other sens and push the piece of metal to close the doors.

 

In this code, everything works very well, no trouble with that.

3. and 4. Ok think I explained almost everything.

5. Yes I  start with one example in Find Example. the Keyword are "Arduino" and "sevo". I just modified a little, but it is approximately the same.

 

6. Not really, I began with Labview two month ago, I watched a lot of video, read a lot of post in this forum, and posted a lot of question..... But Yes I should but time flies!!!!! and I`m here only four month to work.

Anyway,  All my system is in a closed crate, and above there is one camera to see inside. So Before to close the gate, all my flies have to be in the "Y", and I can only see inside with this camera. So I would like to add in this software, one code to be able to see inside my box when i have to open and close the gate.

 

I hope really it is more clear for you,

Thanks

Gerday M

 

 

EDIT: By the way, probably it will be not really necessary, my boss would like to put one timer, So everything will be done automatically. But It doesn`t matter, I would like to know how to do.
It will not be some lost time for me.

0 Kudos
Message 3 of 10
(4,897 Views)

Hello Gerday,

 

Thank you for the code!

 

This makes your set-up already clearer to me.

 

What have you already tried concerning the video acquisition?

Have you already tried these steps?

http://www.ptgrey.com/KB/10791

 

 

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 10
(4,889 Views)

O I didn`t want to say that, sorry.

In fact, I don`t have some troubles with the camera..... I already build some software to record one video or just tak a picture or simple video. I know how to use the camera.

My problem is that I`m not able to add the two codes in the same.

I would like to have the code with the motor (showed in my second post) and also add one simple code to grab an imag. like in this video
https://www.youtube.com/watch?v=aJCxJLuAhTs

 

I tried to add the code for the camera just next to the code for the motor, but everything bug. (if I do that, sometime, the motor works whthout the camera, sometime the camera works without the motor......)

 

I`m sure I need just more knowledge with LabVIEW Vision.

But anyway thanks you

 

0 Kudos
Message 5 of 10
(4,885 Views)

Hello Gerday,

Can you share with me your VI (not the picture) that shows this attempt to combine motor and camera?

I cannot tell you what is wrong with it if I don't see this one.

Please also share the working "Motor only VI" and the working "Camera Only VI". (not the pictures) 

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 6 of 10
(4,881 Views)

Here they are

For the control gate, you need one package called "arduino", but it`s not necessary to open de VI.

And the camera Software is the simple software to grab an image.

But really don`t worry about that, Of course I appreciate your help, and I will be happy if I learn how to do. But don`t waste your time really 🙂

 

Thanks !!!!

Download All
0 Kudos
Message 7 of 10
(4,878 Views)

Hello Gerday,

 

There is still one thing missing.

Where is the VI that contains your attempt to combine camera and opening/closing of the gates?

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 10
(4,848 Views)

Hi,

I tried again, to find one solution...... I did this software but there is a lot of troubles. First I can not finish the software.... It goes round and round in circles in the while loop.... . I can not go out......
Secondly, with this kind of disposition, I have to close the two moteur in the same time.....


If I use the old software "close/open gates" there are two while loop. So I am even more lost.....

By the way, In the old software, I had one while loop at the beginning. In the new, I changed it with an Event Loop. What is the best for you? Because I know that normally the event Loop have to be used with a while loop.....

 

Thanks again

 

Max

0 Kudos
Message 9 of 10
(4,842 Views)

Hello Gerday,

 

Based on my understanding of your code you just want to have n additional "image monitoring loop" in parallel to your working "Simple open close the gates.vi" code.


Why don't you then put your "image acquisition/grabbing/monitoring loop" in parallel of the working code? 

If it only needs to monitor the images, then this approach would be acceptable.

 

The thing you will have to make sure is that you stop your "image acquisition/grabbing/monitoring loop" when your code has finished running.
This could be done easily by using local/global variables.

 

Too get more familiar with how you can program with NI LabVIEW I would suggest that you follow all of these trainings:

http://www.ni.com/academic/students/learn-labview/

 

To learn about some interesting Design Pattens, please have a look over here:
http://www.ni.com/white-paper/7605/en/

 

These should help you in understanding some of the Design Patterns that can be used for your applications.

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 10 of 10
(4,839 Views)