Hello eunkyuhodu,
With the beta waveform generator firmware, the default waveform only plays for 100ms each time you run P.trigger(). If you set P.duration to 10, it should play for 10 seconds. To view the waveform on your oscilloscope, try setting the time scale set to 20ms per division and the voltage scale set to 1 volt per division. The input channel should be set to DC coupled and 1X probe, and the trigger threshold should be set to 500mV in 'normal' mode.
That being said, waveform generator is still in "beta" because it is missing features (e.g. a function to stop playback!) If your goal is to play sine waves of different frequencies, you can use Pulse Pal's standard firmare and set up a looping custom waveform with one period of your sine wave. Here's the setup code:
% Setup (run only once per session)
PulsePal('COM3');
ProgramPulsePalParam(1, 'CustomTrainID', 1);
ProgramPulsePalParam(1, 'CustomTrainLoop', 1);
ProgramPulsePalParam(1, 'PulseTrainDuration', 10); % Seconds to loop the waveform
% Generate and load waveform
freq = 40; % Hz
amplitude = 1; % volts
myWaveform = GenerateZeroPhaseSineWave(freq , amplitude);
SendCustomWaveform(1, 0.0001, myWaveform);
% Trigger
TriggerPulsePal(1);
Please let me know if this works for you.
Thanks,
-Josh