M86: Real-time Vision System Integration
The M86 code queries the camera for the C-axis correction that is required to orient the part for machining.
The camera sends its data to the CNC over the RS232 connection on the CNC's COM1 serial port.
On execution of a M86 command, control sends a ? via RS232 to the camera system. Then the camera looks to see how the part is oriented, and responds with a text string “CI” plus the number of degrees the part will need to be rotated incrementally to be correctly aligned.
The correction is applied to the next M19 command executed.
The com port setup string is stored in a file called viscom.prm, formatted the same as the com port files, e.g. com1:2400,n,8,1,rs,cs,ds,cd, and located in the C:\RUNFILES folder on the harddrive.
Example program lines: