示例#1
0
        public bool SetPostion(PosVarType ptype, PostionVar pv, int pvIndex, PosType pt, int toolNo, int userFrameNo)
        {
            int nConfig;

            nConfig  = (int)pt;
            nConfig |= (pv.NoFlip ? 1 : 0) << 8;
            nConfig |= (pv.LowArm ? 1 : 0) << 9;
            nConfig |= (pv.Back ? 1 : 0) << 10;
            nConfig |= (pv.RGt180 ? 1 : 0) << 11;
            nConfig |= (pv.TGt180 ? 1 : 0) << 12;
            nConfig |= toolNo << 16;
            nConfig |= userFrameNo << 22;

            var cmd = string.Format("cmd={0};usType={1};usIndex={2};nConfig={3};ulValue1={4};ulValue2={5};ulValue3={6};ulValue4={7};ulValue5={8};ulValue6={9};ulValue7={10};ulValue8={11};",
                                    Commands.CMD_MpPutPosVarData, (int)ptype, pvIndex, nConfig,
                                    pv.sOrX, pv.lOrY, pv.uOrZ, pv.bOrRx, pv.rOrRy, pv.tOrRz, 0, 0);

            Send(cmd);
            var s = ReadSck();

            return(s.Contains("OK"));
        }