def Pallet_sq_test(): set_analog_inputrange(0, 0) set_analog_inputrange(1, 0) set_analog_outputdomain(0, 0) set_analog_outputdomain(1, 0) set_tool_voltage(24) set_runstate_outputs([]) set_payload(0.0) set_gravity([0.0, 0.0, 9.82]) cnt_2=0 var_1=1 $ 11 "SubProgram_1" def SubProgram_1(): $ 12 "Pallet" cnt_2_x = cnt_2%4 cnt_2_y = floor(cnt_2/4) pose_2=interpolate_pose(interpolate_pose(p[0.3852984929142884, -0.3855874313395438, 0.06777802132603887, -0.6334284503546749, 1.3943779923605168, 0.6588375844358688],p[0.4949742898793269, -0.1478483122075571, 0.06798566482342258, -0.6338168481029075, 1.3934227737141858, 0.6585542510641902],cnt_2_x/3),interpolate_pose(p[0.4967325439900868, -0.48983789210753614, 0.06786091489250456, -0.6312857504996353, 1.399119691388774, 0.6644378664107233],p[0.6862437869203916, -0.2929920647552933, 0.0681705171465003, -0.6315532477967817, 1.397885609494719, 0.6631791075094505],cnt_2_x/3),cnt_2_y/1) if (cnt_2>=7): cnt_2=0 else: cnt_2=cnt_2+1 end varmsg("cnt_2",cnt_2) $ 19 "PatternPoint_1" movel(pose_trans(pose_2,pose_trans(pose_inv(p[0.38527993856451603, -0.3855933126857668, 0.1718249869977203, -0.6337181471820742, 1.3948974493613928, 0.6585077850841674]),p[0.38527993856451603, -0.3855933126857668, 0.1718249869977203, -0.6337181471820742, 1.3948974493613928, 0.6585077850841674]) ), a=1.2, v=0.25) $ 20 "Action DO[8]=Off" set_digital_out(8,False) $ 21 "Action DO[9]=On" set_digital_out(9,True) $ 22 "Wait 1.0" sleep(1.0) $ 23 "Waypoint_1" movel(pose_trans(pose_2,pose_trans(pose_inv(p[0.38527993856451603, -0.3855933126857668, 0.1718249869977203, -0.6337181471820742, 1.3948974493613928, 0.6585077850841674]),p[0.38533470952425253, -0.38564743754439856, 0.20222134099409753, -0.6335331753190682, 1.3953389761375834, 0.6587209584925396]) ), a=1.2, v=0.25) end $ 1 "BeforeStart" $ 2 "Action DO[8]=On" set_digital_out(8,True) $ 3 "Action DO[9]=Off" set_digital_out(9,False) while True: $ 4 "Robot Program" $ 5 "MoveJ" $ 6 "Waypoint_2" movej([-0.7197472946585313, -1.8273806147498917, -1.824599296451826, -1.3382622046879364, 3.215865211159862, -0.2723225276908634], a=1.3962634015954636, v=1.0471975511965976) $ 7 "Action DO[9]=Off" set_digital_out(9,False) $ 8 "Action DO[8]=On" set_digital_out(8,True) $ 9 "Assignment" global var_1 = var_1+1 varmsg("var_1",var_1) $ 10 "Call SubProgram_1" SubProgram_1() end end