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.