need suggestion on this project

Reply

Join Date: Jun 2006
Posts: 29
Reputation: BombAppetit is an unknown quantity at this point 
Solved Threads: 0
BombAppetit BombAppetit is offline Offline
Light Poster

need suggestion on this project

 
0
  #1
Sep 14th, 2006
greetings

I am currently working on a vision system platform that inspects the marking and orientation of ICs. I have at my disposal is a PC, PIC circuitry, motors, steppers, their respective controllers, and a monochrome progressive scan cameras.

The PIC controls all the functions for mechanism as it receives instructions from the PC through serial port. The mechanism is basically a reel-tape filled with ICs going through inspection by the camera. And then it tells the PC whether it the function has been performed, which puts the respective IC directly under the camera. It is written all in C.

From here on the PC, a VB6 program will compare the image and decide whether the markings are similar or not. IF the markings have too much difference, it then prompts the user to decide whether it is a defect or not.

After that the PC should be sending a signal to the PIC, asking to either move to the next IC or stop or whatever. I plan to make all the IC tracking on the PC instead of PIC, since the result can be displayed on screen.

I need suggestion on how do I go about reading the serial port. Should I read the serial port constantly, from the moment the PC sends signal to the PIC? The function for PIC sending signal to PC is done only once, that is during the time where PIC already determined the IC is in place. Other than that and emergency procedures, there aren't any that I can think of yet.

Is 'constantly reading the port until the appropriate character is received' , the way to go about this? Would it affect the system? Make it hang, or slow it down or anything? I tested this out without any device at the serial port, and naturally it returns an empty string(or so I think it does, not too sure myself), but I'm not sure how it would behave if real hardware sending data is implemented.

Thanks in advance for any form of feedback or suggestion.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 29
Reputation: BombAppetit is an unknown quantity at this point 
Solved Threads: 0
BombAppetit BombAppetit is offline Offline
Light Poster

Re: need suggestion on this project

 
0
  #2
Sep 14th, 2006
sorry about this. i couldnt find any "Edit Message" tab, so i posted a new reply to my own topic. -_-

anyway. how do i write a command that constantly reads the port as long as the form is in view? basically i'm asking here how do i make something that runs transparently when the form is open.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: need suggestion on this project

 
0
  #3
Sep 14th, 2006
hmn, You could try something like:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. if me.visible = true then
  2. ' /* Do Stuff To Read The Port */
  3. doevents
  4. end if
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 29
Reputation: BombAppetit is an unknown quantity at this point 
Solved Threads: 0
BombAppetit BombAppetit is offline Offline
Light Poster

Re: need suggestion on this project

 
0
  #4
Sep 18th, 2006
thanks for that.

unfortunately there's more question. For the camera part, inspecting the marking and orientation of the IC. How do I load a frame from that camera into a PicBox? I need it to set a reference image for comparison purposes, every time the IC passes, the camera captures, the VB program compares. Is a PicBox suitable for this? I went with this due to the fact that i can actually compare dot by dot, getting the percentage difference in its colour, to determine whether it pass or fails.

the camera in use now is a JAI Pulnix TM6760. And i tried using ezVid60.ocx i got off the net, to no avail. it keeps restarting my compiler whenever i run it.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 29
Reputation: BombAppetit is an unknown quantity at this point 
Solved Threads: 0
BombAppetit BombAppetit is offline Offline
Light Poster

Re: need suggestion on this project

 
0
  #5
Sep 20th, 2006
OK.. I have another question. I'll try to get by the previous one.

I have the forms Inspection and PassFail. In the form Inspection there is a function that scans the image, and then calls the form PassFail, prompting the user to decide whether it is a pass or a fail or already end of cycle. PassFail form displays a bit of info.

How do I make PassFail work like a Msgbox/Inputbox? Where it prompts the user and waits for the user to input some stuff, which is when the actual form resumes its operation.

I have a function to stop the machine, before PassFail is loaded, and then resumes machine operation, once PassFail is closed(which decides the next move for the machine, either resume, or stop cycle).

this is what I have conjured so far for that part

CheckForm = False
If Stats = False Then
Load PassFail
PassFail.Show
CheckForm = True
Else
End If
Do
Loop While CheckForm = True

*here CheckForm(which is "Global CheckForm as Boolean" in some module where i store all global functions and variables) will be turned to False once the user decided the next move in PassFail form

it hangs the program. i was hoping the loop to keep the form "Inspection" waiting for result, which is only available after the user input some stuff into PassFail. but it ended up hanging

any suggestion on going about this?
Reply With Quote Quick reply to this message  
Join Date: Sep 2006
Posts: 36
Reputation: sendoshin is an unknown quantity at this point 
Solved Threads: 1
sendoshin sendoshin is offline Offline
Light Poster

Re: need suggestion on this project

 
0
  #6
Sep 28th, 2006
Allow me introduce you to a part of the .Show method that will make this part much easier for you. Instead of

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. CheckForm = False
  2. ...
  3. PassFail.Show
  4. CheckForm = True
  5. ...
  6. Do
  7. Loop While CheckForm = True

you would use

Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
  1. PassFail.Show vbModal

This has the effect of halting the rest of the application until the form PassFail is closed, which is what you seem to be looking for. It also reduces the number of extra variables you have to create, which means it takes up less memory and fewer lines of code - which means a smaller exectuable.

I unfortunately cannot (as of yet) help you with the camera images issue. I'm currently having an issue of my own involving images, though I have a few more tricks I'm going to try before I ask for help here.

Anyhow, I hope this little tidbit helps a bit!

- Sendoshin
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 29
Reputation: BombAppetit is an unknown quantity at this point 
Solved Threads: 0
BombAppetit BombAppetit is offline Offline
Light Poster

Re: need suggestion on this project

 
0
  #7
Oct 16th, 2006
thanks sedonshin for that snippet. Never noticed such feature for form loading.

anyway.. i got myself a Jai Pulnix CV-M10 and a Matrox MeteorII Multichannel imager. is there any thing i should be worried about before plugging these into my PC?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC