Esempio n. 1
0
        //Attenuator
        private void setAttenuatorValue(int deviceId, double attenuatorValue)
        {
            Attenuator.fnLDA_SetTestMode(false);
            Attenuator.fnLDA_InitDevice(deviceId);

            double value = attenuatorValue / 0.25;

            Attenuator.fnLDA_SetAttenuation(deviceId, (int)value);
            //MessageBox.Show(Attenuator.fnLDA_GetAttenuation(deviceId).ToString());
            Attenuator.fnLDA_CloseDevice(deviceId);
        }
Esempio n. 2
0
        private void detectAttenuator()
        {
            attenuator1 = 0;

            label3.Text = "Attenuator(NA)";
            label4.Text = "Attenuator(NA)";
            label5.Text = "Attenuator(NA)";
            label6.Text = "Attenuator(NA)";

            Attenuator.fnLDA_SetTestMode(false);
            int device = Attenuator.fnLDA_GetNumDevices();

            for (int i = 0; i < device; i++)
            {
                Attenuator.fnLDA_InitDevice(i + 1);
                int serialNumber = Attenuator.fnLDA_GetSerialNumber(i + 1);

                switch (i)
                {
                case 0:
                    attenuator1 = i + 1;
                    label3.Text = "Attenuator (" + attenuator1 + ")";
                    break;

                case 1:
                    attenuator1 = i + 1;
                    label4.Text = "Attenuator (" + attenuator1 + ")";
                    break;

                case 2:
                    attenuator1 = i + 1;
                    label5.Text = "Attenuator (" + attenuator1 + ")";
                    break;

                case 3:
                    attenuator1 = i + 1;
                    label6.Text = "Attenuator (" + attenuator1 + ")";
                    break;
                }

                Attenuator.fnLDA_CloseDevice(i + 1);
            }
        }