This example shows how to capture and view video images from a Camera Link camera attached to the Bitflow™ Neon-CLB frame grabber board. Images are acquired with the model
dxpcImMultiTarget running on the target computer and viewed with the model
dxpcImMultiHost running on the development computer.
dxpcImMultiTarget is a multirate multitasking model. Images are captured at 30Hz and then compressed and transmitted to the development computer at 10 Hz.
Computer Vision System Toolbox™
Bitflow Neon-CLB frame grabber installed in the target computer
Bitflow SDK installed on the development computer
Camera Link camera supported by the Bitflow Neon-CLB frame grabber
Click here to open the target computer model:
% Open the model. mdlOpen = 0; systems = find_system('type', 'block_diagram'); if ~any(strcmp(systems,'dxpcImMultiTarget')) mdlOpen = 1; open_system('dxpcImMultiTarget'); end
% Build the model and download to the target computer, TargetPC1. set_param('dxpcImMultiTarget','RTWVerbose','off'); % Configure for a non-Verbose build. rtwbuild('dxpcImMultiTarget'); % Build and download application.
### Starting Simulink Real-Time build procedure for model: dxpcImMultiTarget ### Generated code for 'dxpcImMultiTarget' is up to date because no structural, parameter or code replacement library changes were found. ### Successful completion of build procedure for model: dxpcImMultiTarget ### Looking for target: TargetPC1 ### Download model onto target: TargetPC1
% Close the target model if we opened it. if (mdlOpen) bdclose('dxpcImMultiTarget'); end
Click here to open the Simulink® model on the development computer:
This model receives compressed images sent by
dxpcImMultiTarget, decompresses the images, and renders them to a video display.
% Open the model. mdlOpen = 0; systems = find_system('type', 'block_diagram'); if ~any(strcmp(systems,'dxpcImMultiHost')) mdlOpen = 1; open_system('dxpcImMultiHost'); end
% Using the Simulink Real-Time(TM) object variables |tg|, start the target computer model. start(tg); % Start the target computer model. pause(1); % Wait for 1 sec. % Start the Simulink model. set_param(bdroot,'SimulationCommand','start'); % Start the develpment computer model. pause(10); % Wait for 10 sec.
% Render the video display. open_system([bdroot,'/To Video Display']);
% Plot the image size. open_system([bdroot,'/Scope']);
stop(tg); % Stop the target computer model. set_param(bdroot,'SimulationCommand','stop'); % Stop the Simulink model. % Close the development computer model if we opened it. if (mdlOpen) bdclose('dxpcImMultiHost'); end % EOF dxpcImMultiDemo.m