Exemple #1
0
 static public void stopgenerator()
 {
     if (_handle >= 0)
     {
         ulong retval        = Imports.PICO_OK;
         long  offsetVoltage = 0;      //uV
         ulong pkToPk        = 0;      //uV
         Imports.enPS5000AWaveType waveType = Imports.enPS5000AWaveType.PS5000A_SINE;
         float startFrequency = 80000; // Hz
         float stopFrequency  = startFrequency;
         float increment      = 1.0F;  //Hz
         float dwellTime      = 1.0F;  //seconds on each frequency increment
         Imports.enPS5000ASweepType       sweepType = Imports.enPS5000ASweepType.PS5000A_UPDOWN;
         Imports.enPS5000AExtraOperations operation = Imports.enPS5000AExtraOperations.PS5000A_ES_OFF;
         ulong shots  = Imports.PS5000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN;
         ulong sweeps = Imports.PS5000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN;
         Imports.enPS5000ASigGenTrigType   triggerType   = Imports.enPS5000ASigGenTrigType.PS5000A_SIGGEN_RISING;
         Imports.enPS5000ASigGenTrigSource triggerSource = Imports.enPS5000ASigGenTrigSource.PS5000A_SIGGEN_NONE;
         short extInThreshold = 0;
         retval = Imports.ps5000aSetSigGenBuiltIn(_handle, offsetVoltage, pkToPk, waveType, startFrequency, stopFrequency, increment,
                                                  dwellTime, sweepType, operation, shots, sweeps,
                                                  triggerType, triggerSource, extInThreshold);
         if (retval == Imports.PICO_OK)
         {
             devicelogs += "Generator Stopped\n";
         }
         else
         {
             devicelogs += "ERROR: Generator not Stopped\n";
         }
     }
 }
Exemple #2
0
 //pd. 3)
 private void buttonStartGenerator_Click(object sender, EventArgs e)
 {
     if (_handle >= 0)
     {
         ulong retval        = Imports.PICO_OK;
         long  offsetVoltage = 0;      //uV
         ulong pkToPk        = 200000; //uV
         Imports.enPS5000AWaveType waveType = Imports.enPS5000AWaveType.PS5000A_SINE;
         float startFrequency = 1000;  // Hz
         float stopFrequency  = startFrequency;
         float increment      = 1.0F;  //Hz
         float dwellTime      = 1.0F;  //seconds on each frequency increment
         Imports.enPS5000ASweepType       sweepType = Imports.enPS5000ASweepType.PS5000A_UPDOWN;
         Imports.enPS5000AExtraOperations operation = Imports.enPS5000AExtraOperations.PS5000A_ES_OFF;
         ulong shots  = Imports.PS5000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN;
         ulong sweeps = Imports.PS5000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN;
         Imports.enPS5000ASigGenTrigType   triggerType   = Imports.enPS5000ASigGenTrigType.PS5000A_SIGGEN_RISING;
         Imports.enPS5000ASigGenTrigSource triggerSource = Imports.enPS5000ASigGenTrigSource.PS5000A_SIGGEN_NONE;
         short extInThreshold = 0;
         retval = Imports.ps5000aSetSigGenBuiltIn(_handle, offsetVoltage, pkToPk, waveType, startFrequency, stopFrequency, increment,
                                                  dwellTime, sweepType, operation, shots, sweeps,
                                                  triggerType, triggerSource, extInThreshold);
         if (retval == Imports.PICO_OK)
         {
             this.buttonStartGenerator.Text = "Started";
         }
     }
 }
Exemple #3
0
        //pd. 3)
        static public void startgenerator()
        {
            if (_handle >= 0)
            {
                ulong retval        = Imports.PICO_OK;
                long  offsetVoltage = _offsetVoltage; //uV
                ulong pkToPk        = _pkToPk;        //uV
                //Imports.enPS5000AWaveType waveType = Imports.enPS5000AWaveType.PS5000A_SINE;
                Imports.enPS5000AWaveType waveType = (Imports.enPS5000AWaveType)waveforms.GetValue(rangeinds[4]);
                float startFrequency = sweeprate; // 80000; // Hz
                float stopFrequency  = startFrequency;
                float increment      = 1.0F;      //Hz
                float dwellTime      = 1.0F;      //seconds on each frequency increment
                Imports.enPS5000ASweepType       sweepType = Imports.enPS5000ASweepType.PS5000A_UPDOWN;
                Imports.enPS5000AExtraOperations operation = Imports.enPS5000AExtraOperations.PS5000A_ES_OFF;
                ulong shots  = Imports.PS5000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN;
                ulong sweeps = Imports.PS5000A_SHOT_SWEEP_TRIGGER_CONTINUOUS_RUN;
                Imports.enPS5000ASigGenTrigType   triggerType   = Imports.enPS5000ASigGenTrigType.PS5000A_SIGGEN_RISING;
                Imports.enPS5000ASigGenTrigSource triggerSource = Imports.enPS5000ASigGenTrigSource.PS5000A_SIGGEN_NONE;
                short extInThreshold = 0;

                if ((pkToPk + (ulong)Math.Abs(offsetVoltage * 2)) > 4000000)
                {
                    pkToPk  = 2000000 - (ulong)Math.Abs(offsetVoltage);
                    _pkToPk = pkToPk;
                }
                retval = Imports.ps5000aSetSigGenBuiltIn(_handle, offsetVoltage, pkToPk, waveType, startFrequency, stopFrequency, increment,
                                                         dwellTime, sweepType, operation, shots, sweeps,
                                                         triggerType, triggerSource, extInThreshold);
                if (retval == Imports.PICO_OK)
                {
                    devicelogs += "Generator Started\n";
                }
                else
                {
                    devicelogs += "ERROR: Generator not Started\n";
                }
            }
        }