Currently we're sending a digital output to our behavior system (bpod) as a feedback, which uses the same input as trigger as the analog output that controls laser and delivers light to the brain. but I've observed from our behavior video that sometimes the light obviously delivered about 4s when the digital feedback only still reports 1s. Thus to make sure that the feedback is actually reliable, or just to double check that the setting sent to PulsePal has been successfully written to it, I want to use the function ReadSDProgram provided by PulsePal, which returns the last program loaded from PulsePal's microSD card (https://sites.google.com/site/pulsepalwiki/matlab-gnu-octave/functions/readsdprogram). This gives a 178 byte vector, but I don't know how to convert that byte vector to the same format as ParameterMatrix so that I can check whether the two are the same?
obj.opto_trial_info.fixed_duration = obj.settings.opto_info.fixed_duration(1); % 4s, not including ramp down
fix_duration_wave = [this_trig_onset_wave,ones(1,3.97*Fs),linspace(1,0,0.1*Fs)]; %30ms onset ramp, 3970ms steady output, 100ms ramp down
ParameterMatrix(2:13, 3) = {0 5 0 obj.opto_trial_info.fixed_duration 0 0 0.25 0 0 1 0 1}; % Set output channel 2 parameters
ParameterMatrix{15,2} = 1; % channel 1 use pulse train 1
ParameterMatrix{15,3} = 0; % channel 2 use default TTL
ParameterMatrix{13,2} = 1; % both channel 1 and 2 are using trigger input 1
ParameterMatrix{13,3} = 1; % both channel 1 and 2 are using trigger input 1
ProgramPulsePal(ParameterMatrix); % Send matrix of parameters to Pulse Pal
SendCustomWaveform(1, 1/Fs, fix_duration_wave); %set output channel 1 to use this custom train 'fix_duration_wave' (our analog waveform)