03-27-2015 07:05 AM
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:
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 ^^
04-02-2015 03:34 AM
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?
Without a better understanding of your issues it will be not possible for me to help you.
04-03-2015 03:44 AM - edited 04-03-2015 03:47 AM
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.
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)
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.
04-03-2015 07:48 AM
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
04-03-2015 08:15 AM
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
04-03-2015 09:13 AM - edited 04-03-2015 09:14 AM
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)
04-03-2015 09:29 AM
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 !!!!
04-07-2015 01:40 AM
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?
04-07-2015 04:32 AM
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
04-07-2015 05:32 AM
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.