コード例 #1
0
        public UInt16 getWaveLegnth()//Need to implement
        {
            byte[] readBytes = new byte[2];
            UInt16 w;

            lambdaCom.clearBuffer();
            lambdaCom.writeByte(219 /*byteCom.byteGetWlength*/);
            readBytes[0] = lambdaCom.readByte();//Clear DB return
            readBytes[0] = lambdaCom.readByte();
            Thread.Sleep(10);
            readBytes[1] = lambdaCom.readByte();                //txtBoxDialog.AppendText("base Posstion " + b + Environment.NewLine);
            w            = BitConverter.ToUInt16(readBytes, 0); //w = int (w1 >> 8) + int (w2);
            return(w);
        }
コード例 #2
0
ファイル: vf5Functions.cs プロジェクト: miketaormina/SPIMcode
        public int[] getBaseFilters()
        {
            byte loop = 0;

            int[] baseVal  = new int[5];
            int   filter_0 = 0;
            int   filter_1 = 0;
            int   filter_2 = 0;
            int   filter_3 = 0;
            int   filter_4 = 0;

            com.writeByte(byteCom.byteVFpossition);
            com.clearBuffer();
            com.writeByte(byteCom.byteGetVFAll);
            while (loop != byteCom.byteCR)
            {
                Thread.Sleep(1);
                System.Windows.Forms.Application.DoEvents();
                loop = com.readByte();
                switch (loop)
                {
                case 240:
                    filter_0 = com.readByte();
                    Thread.Sleep(1);
                    Thread.Sleep(1);
                    baseVal[0] = filter_0 + (256 * com.readByte());
                    break;

                case 242:
                    Thread.Sleep(1);
                    filter_1 = com.readByte();
                    Thread.Sleep(1);
                    baseVal[1] = filter_1 + (256 * com.readByte());
                    break;

                case 244:
                    Thread.Sleep(1);
                    filter_2 = com.readByte();
                    Thread.Sleep(1);
                    baseVal[2] = filter_2 + (256 * com.readByte());
                    break;

                case 246:
                    Thread.Sleep(1);
                    filter_3 = com.readByte();
                    Thread.Sleep(1);
                    baseVal[3] = filter_3 + (256 * com.readByte());
                    break;

                case 248:
                    //Thread.Sleep(1);
                    Thread.Sleep(1);
                    filter_4 = com.readByte();
                    Thread.Sleep(1);
                    baseVal[4] = filter_4 + (256 * com.readByte());
                    break;
                }
            }
            return(baseVal);
        }