Skip to content

Commit

Permalink
Added Talkingto to new sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Shrediquette committed Jan 17, 2025
1 parent 5fd16eb commit a9b2ca7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions +acquisition/control_simple_sync_serial.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@
framerate=str2double(ac_fps_str(ac_fps_value));
f1exp_cam=gui.retr('f1exp_cam');
[~, pin_string,~,frame_time] = PIVlab_calc_oltsync_timings(camera_type,camera_sub_type,bitmode,framerate,f1exp_cam,pulse_sep,las_percent);
send_string=['sequence:' int2str(frame_time) ':0,0:' pin_string];
send_string=['TALKINGTO:' laser_device_id ':sequence:' int2str(frame_time) ':0,0:' pin_string];
writeline(serpo,send_string);
%pause(0.05)
%flush(serpo)
%pause(0.05)
pause(0.05)
writeline(serpo,'start');
send_string=['TALKINGTO:' laser_device_id ':start'];
writeline(serpo,send_string);
end

else
Expand All @@ -91,7 +92,8 @@
send_string=['TALKINGTO:' laser_device_id ';FREQ:1;CAM:1;ENER:' int2str(min_energy) ';ener%:0;F1EXP:100;INTERF:1234;EXTDLY:-1;EXTSKP:0;LASER:disable'];
writeline(serpo,send_string);
elseif strcmpi(gui.retr('sync_type'),'oltSync')
writeline(serpo,'stop');
send_string=['TALKINGTO:' laser_device_id ':stop'];
writeline(serpo,send_string);
end

end
Expand All @@ -106,16 +108,18 @@
writeline(serpo,'CAMERA_FREERUN_ON!');
elseif strcmpi(gui.retr('sync_type'),'oltSync')
%toggle the camera with approx 20 Hz
send_string=['sequence:' int2str(50000) ':0,0:' '100,1100:0,0'];
send_string=['TALKINGTO:' laser_device_id ':sequence:50000:0,0:100,1100:'];
writeline(serpo,send_string);
pause(0.2)
writeline(serpo,'start');
send_string=['TALKINGTO:' laser_device_id ':start'];
writeline(serpo,send_string);
end
elseif calibration_pulse ==2
if strcmpi(gui.retr('sync_type'),'xmSync')
writeline(serpo,'CAMERA_FREERUN_OFF!');
elseif strcmpi(gui.retr('sync_type'),'oltSync')
writeline(serpo,'stop');
send_string=['TALKINGTO:' laser_device_id ':stop'];
writeline(serpo,send_string);
end
end
end
Expand Down

0 comments on commit a9b2ca7

Please sign in to comment.