RobotStudio event

Vision System

I am trying to implement a robot mounted Cognex vision system. The problem I am having is, because of the locations of the parts I am checking, axis 6 has to rotate to various angles. All I need is the x, y component, but because of the rotation, the coordinate system isn't the same as the work object. This is what I'm doing to convert the camera point, but I cant get it to convert to the new work object: PROC rCNV_Point(INOUT robtarget point,PERS tooldata told,PERS tooldata tnew,PERS wobjdata wold,PERS wobjdata wnew) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!! This converts a point from one workobject to another workobject.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! VAR pose ppnt:=[[0,0,0],[1,0,0,0]]; VAR pose ppntnew:=[[0,0,0],[1,0,0,0]]; VAR pose pb:=[[0,0,0],[1,0,0,0]]; VAR pose pa:=[[0,0,0],[1,0,0,0]]; VAR jointtarget jP1:=[[0,0,0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]; !Move Information ppnt.trans:=point.trans; ppnt.rot:=point.rot; !Calculate Conversion Info. ppntnew:=PoseMult(PoseMult(wold.uframe,wold.oframe),ppnt); ppntnew:=PoseMult(PoseInv(PoseMult(wnew.uframe,wnew.oframe)),ppntnew); !Convert Data. ppntnew:=PoseMult(pa,pb); !Overwrite Point. point.trans:=ppntnew.trans; point.rot:=ppntnew.rot; I can verify that the first Pose shifts the point to WOBJ0, but i cant get it to shift to the new work object. Thoughts??