private void buttonDWGstrobeOutWithTrigger_Click(object sender, EventArgs e) { // Config the Output Bus 0 in pins 0 to 15 of Port 0 moduleDIO.busConfig(SD_DIO_Bus.DIO_OUTPUT_BUS0, 0, 0, 15); // Config the Strobe 0 moduleDIO.busSamplingConfig(SD_DIO_Bus.DIO_OUTPUT_BUS0, 0, SD_Strobe.STROBE_ON, SD_Strobe.STROBE_EDGERISE, 0, 0, SD_DebouncingTypes.DEBOUNCING_NONE); //Config pins 0 to 15 of Port 0 as output moduleDIO.IOdirectionConfig(0x000000000000FFFF, SD_PinDirections.DIR_OUT); // Create waveforms objects in PC RAM from waveforms files SD_Wave waveId1 = new SD_Wave("W:\\Waveforms_Demo\\Alberto\\DigitalTest_32samples.txt"); SD_Wave waveId2 = new SD_Wave("W:\\Waveforms_Demo\\Alberto\\DigitalTest_48samples.txt"); if (waveId1.getStatus() < 0 || waveId1.getStatus() < 0) { printToConsole("Error opening waveform File\n"); runPause(); // Waves will be freed by garbage colletor return; } // Erase all waveforms from module memory and load waveforms waveId1 and waveId2 in position nWave1 and nWave2 moduleDIO.waveformFlush(); moduleDIO.waveformLoad(waveId1, 0); moduleDIO.waveformLoad(waveId2, 1); // Flush channel waveform queue moduleDIO.DWGflush(nChannel); // Queue waveforms nWave1 and nWave2 in nChannel moduleDIO.DWGqueueWaveform(nChannel, 0, SD_TriggerModes.AUTOTRIG, 0, 1, 1); moduleDIO.DWGqueueWaveform(nChannel, 1, SD_TriggerModes.VIHVITRIG, 0, 1, 1); printToConsole("Module configuration successfull. Press any key to start the DWG."); runPause(); moduleDIO.DWGstart(nChannel); printToConsole("DWG started. Press any key to send a VI/HVI trigger."); runPause(); moduleDIO.DWGtrigger(nChannel); printToConsole("Press any key to stop the DWG."); runPause(); moduleDIO.DWGstop(nChannel); printToConsole("DWG Stopped. Press any key to finish."); runPause(); }
private void buttonTestFrequencyModulation_Click(object sender, EventArgs e) { // Create a waveform object in PC RAM from waveform file SD_Wave wave = new SD_Wave("..\\..\\..\\..\\..\\..\\..\\Waveforms\\Gaussian.csv"); if (wave.getStatus() < 0) { printToConsole("Error opening waveform File"); runPause(); return; } int nWave = 0; // Erase all waveforms from module memory and load the waveform waveID in position nWave moduleAOU.waveformFlush(); moduleAOU.waveformLoad(wave, nWave); // Turn off nChannel moduleAOU.channelWaveShape(nChannel, SD_Waveshapes.AOU_OFF); // Switch off amplitude modulation and setup FM modulation moduleAOU.modulationAmplitudeConfig(nChannel, SD_ModulationTypes.AOU_MOD_OFF, 0); moduleAOU.modulationAngleConfig(nChannel, SD_ModulationTypes.AOU_MOD_FM, 10 * 1E6); // Deviation Gain = 10 * 1E6 (in Hz) // Config amplitude, frequency and shape moduleAOU.channelAmplitude(nChannel, 1.0); // 1 Volts Peak moduleAOU.channelFrequency(nChannel, 10E6); // 10 MHz moduleAOU.channelWaveShape(nChannel, SD_Waveshapes.AOU_SINUSOIDAL); // Flush channel waveform queue moduleAOU.AWGflush(nChannel); // Queue waveform nWave in nChannel moduleAOU.AWGqueueWaveform(nChannel, nWave, SD_TriggerModes.AUTOTRIG, 0, 0, 1); printToConsole("Module configuration successfull. Press CONTINUE to start the AWG"); runPause(); moduleAOU.AWGstart(nChannel); printToConsole("AWG started. Press CONTINUE to stop the AWG."); runPause(); moduleAOU.AWGstop(nChannel); printToConsole("AWG Stopped. Press CONTINUE to finish."); runPause(); }
private void buttonTestWaveformContinuous_Click(object sender, EventArgs e) { // Create a waveform object in PC RAM from waveform file SD_Wave wave = new SD_Wave("..\\..\\..\\..\\..\\..\\..\\Waveforms\\Triangular.csv"); if (wave.getStatus() < 0) { printToConsole("Error opening waveform File"); return; } int nWave = 0; // Switch off angle modulation and Amplitude modulation moduleAOU.modulationAngleConfig(nChannel, SD_ModulationTypes.AOU_MOD_OFF, 0); moduleAOU.modulationAmplitudeConfig(nChannel, SD_ModulationTypes.AOU_MOD_OFF, 0); // Erase all waveforms from module memory and load the waveform waveID in position nWave moduleAOU.waveformFlush(); moduleAOU.waveformLoad(wave, nWave); // Config amplitude and setup AWG in nChannel moduleAOU.channelAmplitude(nChannel, 1.2); // 1.2 Volts Peak moduleAOU.channelWaveShape(nChannel, SD_Waveshapes.AOU_AWG); // Flush channel waveform queue moduleAOU.AWGflush(nChannel); // Queue waveform nWave in nChannel moduleAOU.AWGqueueWaveform(nChannel, nWave, SD_TriggerModes.AUTOTRIG, 0, 0, 0); // Cycles = 0 printToConsole("Module configuration successfull. Press CONTINUE to start the AWG"); runPause(); moduleAOU.AWGstart(nChannel); printToConsole("AWG started. Press CONTINUE to pause the AWG."); runPause(); moduleAOU.AWGpause(nChannel); printToConsole("AWG paused. Press CONTINUE to resume the AWG."); runPause(); moduleAOU.AWGresume(nChannel); printToConsole("AWG resumed. Press CONTINUE to stop the AWG."); runPause(); moduleAOU.AWGstop(nChannel); printToConsole("AWG stopped. Press CONTINUE to start the AWG."); runPause(); moduleAOU.AWGstart(nChannel); printToConsole("AWG started. Press CONTINUE to stop the AWG."); runPause(); moduleAOU.AWGstop(nChannel); printToConsole("AWG Stopped. Press CONTINUE to finish."); runPause(); }
private void buttonTestMultipleWaveforms_Click(object sender, EventArgs e) { clearConsole(); int nWave1 = 0; int nWave2 = 1; // Create a waveform object in PC RAM from waveform file SD_Wave wave1 = new SD_Wave("..\\..\\..\\..\\..\\..\\..\\Waveforms\\Triangular.csv"); SD_Wave wave2 = new SD_Wave("..\\..\\..\\..\\..\\..\\..\\Waveforms\\Gaussian.csv"); if (wave1.getStatus() < 0 || wave2.getStatus() < 0) { printToConsole("Error opening waveform File"); return; } // Erase all waveforms from module memory and load waveforms waveId1 and waveId2 in positions nWave1 and nWave2 moduleAOU.waveformFlush(); moduleAOU.waveformLoad(wave1, nWave1); moduleAOU.waveformLoad(wave2, nWave2); // Turn off nChannel moduleAOU.channelWaveShape(nChannel, SD_Waveshapes.AOU_OFF); // Switch off angle modulation and Amplitude modulation moduleAOU.modulationAngleConfig(nChannel, SD_ModulationTypes.AOU_MOD_OFF, 0); moduleAOU.modulationAmplitudeConfig(nChannel, SD_ModulationTypes.AOU_MOD_OFF, 0); // Config amplitude and setup AWG in nChannel moduleAOU.channelAmplitude(nChannel, 1.2); // 1.2 Volts Peak moduleAOU.channelWaveShape(nChannel, SD_Waveshapes.AOU_AWG); // Flush channel waveform queue moduleAOU.AWGflush(nChannel); // Queue waveforms nWave1 and nWave2 in nChannel moduleAOU.AWGqueueWaveform(nChannel, nWave1, SD_TriggerModes.AUTOTRIG, 0, 1, 0); moduleAOU.AWGqueueWaveform(nChannel, nWave2, SD_TriggerModes.AUTOTRIG, 0, 2, 0); printToConsole("Module configuration successfull. Press CONTINUE to start the AWG"); runPause(); moduleAOU.AWGstart(nChannel); printToConsole("AWG started. Press CONTINUE to stop the AWG."); runPause(); moduleAOU.AWGstop(nChannel); printToConsole("AWG Stopped. Press CONTINUE to start the AWG."); runPause(); moduleAOU.AWGstart(nChannel); printToConsole("AWG started. Press CONTINUE to restart the AWG."); runPause(); moduleAOU.AWGstart(nChannel); printToConsole("AWG started. Press CONTINUE to stop the AWG."); runPause(); moduleAOU.AWGstop(nChannel); printToConsole("AWG Stopped. Press CONTINUE to finish."); runPause(); }
private void buttonTestWaveformTrigger_Click(object sender, EventArgs e) { clearConsole(); // Create a waveform object in PC RAM from waveform file SD_Wave wave1 = new SD_Wave("..\\..\\..\\..\\..\\..\\..\\Waveforms\\Triangular.csv"); SD_Wave wave2 = new SD_Wave("..\\..\\..\\..\\..\\..\\..\\Waveforms\\Gaussian.csv"); if (wave1.getStatus() < 0 || wave2.getStatus() < 0) { printToConsole("Error opening waveform File"); return; } int nWave1 = 0; int nWave2 = 1; // Erase all waveforms from module memory and load waveforms waveId1 and waveId2 in position nWave1 and nWave2 moduleAOU.waveformFlush(); moduleAOU.waveformLoad(wave1, nWave1); moduleAOU.waveformLoad(wave2, nWave2); // Turn off nChannel moduleAOU.channelWaveShape(nChannel, SD_Waveshapes.AOU_OFF); // Switch off angle modulation and Amplitude modulation moduleAOU.modulationAngleConfig(nChannel, SD_ModulationTypes.AOU_MOD_OFF, 0); moduleAOU.modulationAmplitudeConfig(nChannel, SD_ModulationTypes.AOU_MOD_OFF, 0); // Config amplitude and setup AWG in nChannel moduleAOU.channelAmplitude(nChannel, 1.2); // 1.2 Volts Peak moduleAOU.channelWaveShape(nChannel, SD_Waveshapes.AOU_AWG); // Set external trigger as input moduleAOU.triggerIOdirection(SD_TriggerDirections.AOU_TRG_IN); // Config trigger as external trigger and rising edge moduleAOU.AWGtriggerExternalConfig(nChannel, SD_TriggerExternalSources.TRIGGER_EXTERN, SD_TriggerBehaivors.TRIGGER_RISE); // Flush channel waveform queue moduleAOU.AWGflush(nChannel); // Queue waveform nWave1 with VI/HVI trigger and delay of 50ns from the trigger moduleAOU.AWGqueueWaveform(nChannel, nWave1, SD_TriggerModes.VIHVITRIG, 50, 1, 0); // Queue waveform nWave1 with external trigger and delay of 100ns from the trigger moduleAOU.AWGqueueWaveform(nChannel, nWave1, SD_TriggerModes.EXTTRIG, 100, 1, 0); // Queue waveforms nWave1 and nWave2 with differents trigger and delay of 200ns from the trigger and between them moduleAOU.AWGqueueWaveform(nChannel, nWave2, SD_TriggerModes.EXTTRIG, 200, 1, 0); moduleAOU.AWGqueueWaveform(nChannel, nWave1, SD_TriggerModes.AUTOTRIG, 280, 1, 0); printToConsole("External trigger configurated.\nModule configuration successfull, Press CONTINUE to start the AWG"); runPause(); moduleAOU.AWGstart(nChannel); printToConsole("AWG started. Waiting for the triggers. Press CONTINUE to send a VI/HVI trigger."); runPause(); moduleAOU.AWGtrigger(nChannel); printToConsole("Waiting for two external triggers. Press CONTINUE to stop the AWG."); runPause(); moduleAOU.AWGstop(nChannel); printToConsole("AWG Stopped. Test Finished."); }