SK91USB3-LX  1.2.0
Functions
Camera Synchronization

Explains how to synchronize / trigger the camera. More...

Functions

int SK_SETSYNCMODE (int CamID, unsigned char syncMode)
 Sets synchronization mode. More...
 
int SK_SETSYNCDIVIDER (int CamID, int divider)
 Sets a divider for the trigger clock. More...
 
int SK_SETFRAMESYNC (int CamID, bool breakenable)
 Activates the frame trigger synchronization (FrameSync). More...
 
int SK_SETFRAMESYNCDELAY (int CamID, int linesOfDelay)
 Sets a delay for FrameSync. More...
 
int SK_FRAMESYNCRESET (int CamID)
 Disables the FrameSync mode. More...
 
int SK_GETSYNCMODE (int CamID)
 Returns the synchronization mode by reading the result of serial command "I22". More...
 
int SK_GETCURRENTSYNCMODE (int CamID)
 Returns the current used synchronization mode which was programmed at last by SK_SETSYNCMODE. More...
 
int SK_GETSYNCDIVIDERFROMCAMERA (int CamID)
 Returns the current synchronization divider by reading the result of serial command "I28". More...
 
int SK_GETSYNCCONTROLFROMCAMERA (int CamID)
 Returns synchronisation control register. More...
 
int SK_GETFRAMESYNCDELAY (int CamID)
 Returns FrameSync delay. More...
 
int SK_GETSYNCMODEFROMCAMERA (int CamID)
 Returns the current synchronization mode by reading the result of serial command "I22". More...
 
int SK_GETFRAMESYNCLINES (int CamID)
 Returns the number of lines per frame for FrameSync trigger. More...
 

Detailed Description

Explains how to synchronize / trigger the camera.

The Synchronization modes determine the timing of the line scan and can be performed internally or by trigger signals sourced externally.

USB_3_0_Kamera_Sync.png

The line scan camera system has two modes of external synchronization:

FreeRun / SK Mode 0
Each line is acquired by internal synchronization. The completion of one line scan initiates the subsequent line scan immediately (free-running).

LineStart / SK Mode 1
An external trigger (TTL at Pin 5, falling edge) initiates the read-out of the current exposed line at the next trigger without any effect on the exposure process. The start of exposure is not controlled and the exposure time is determined by the programmed value. The exposed line is held in the camera up until the next trigger. The trigger clock determines the line frequency.
Restriction: the TTL period must be longer than the exposure time.

ExposureStart / SK Mode 4
An external trigger (TTL at Pin 5, falling edge) resets the current exposure and starts a new exposure process. The exposure time is determined by the programmed value. The exposed line will be read out with the next trigger. The trigger clock determines the line frequency. Restriction: the TTL period must be longer than the exposure time.

ExposureActive / SK extSOS (mode 5)
The start-of-scan (SOS) pulse of the camera is generated externally by a TTL-source. The TTL clock period determines the exposure time of the camera. The exposed line will be read out with the next trigger.

FrameTrigger / SK FrameSync
This trigger mode generates a set of lines (frame, image) and waits for a falling TTL edge at the "FrameSync" intput (Pin 3). The FrameSync works independently of the programmed line synchronization (see SK_SETSYNCMODE). The falling TTL edge starts an acquisition of one frame for the programmed number of lines. For further external line synchronization inside of an initiated frame then an additional TTL clock is required for every line event interruption.

Function Documentation

int SK_FRAMESYNCRESET ( int  CamID)

Disables the FrameSync mode.

See also
SK_GETFRAMESYNCLINES
SK_SETFRAMESYNC
Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
Returns
SK_RESULT_OK on success, else see Error Code Table
int SK_GETCURRENTSYNCMODE ( int  CamID)

Returns the current used synchronization mode which was programmed at last by SK_SETSYNCMODE.

Remarks
This function is faster than SK_GETSYNCMODE.
See also
SK_SETSYNCMODE
SK_GETSYNCMODE
SK_GETSYNCMODEFROMCAMERA
Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
Returns
synchronization mode as number, else see Error Code Table
int SK_GETFRAMESYNCDELAY ( int  CamID)

Returns FrameSync delay.

Parameters
CamIDid of camera
Returns
FrameSync delay
int SK_GETFRAMESYNCLINES ( int  CamID)

Returns the number of lines per frame for FrameSync trigger.

See also
SK_FRAMESYNCRESET
SK_SETFRAMESYNC
Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
Returns
number of lines per frame, else see Error Code Table
int SK_GETSYNCCONTROLFROMCAMERA ( int  CamID)

Returns synchronisation control register.

Parameters
CamIDid of camera
Returns
synchronisation divider or error (= 0)
int SK_GETSYNCDIVIDERFROMCAMERA ( int  CamID)

Returns the current synchronization divider by reading the result of serial command "I28".

See also
SK_SETSYNCDIVIDER
Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
Returns
current synchronization divider, else see Error Code Table
int SK_GETSYNCMODE ( int  CamID)

Returns the synchronization mode by reading the result of serial command "I22".

See also
SK_SETSYNCMODE
SK_GETCURRENTSYNCMODE
SK_GETSYNCMODEFROMCAMERA
Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
Returns
synchronization mode as number, else see Error Code Table
int SK_GETSYNCMODEFROMCAMERA ( int  CamID)

Returns the current synchronization mode by reading the result of serial command "I22".

See also
SK_SETSYNCMODE
SK_GETCURRENTSYNCMODE
SK_GETSYNCMODE
Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
Returns
synchronization mode as number, else see Error Code Table
int SK_SETFRAMESYNC ( int  CamID,
bool  breakenable 
)

Activates the frame trigger synchronization (FrameSync).

Note
LineSync and FrameSync are separate signal inputs at the camera I/O connector.
Remarks
The frame synchronization can be activated also by input parameter in SK_GRAB and SK_GRABCONTINUOUS.
See also
SK_FRAMESYNCRESET
SK_GETFRAMESYNCLINES
Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
breakenablenot used
Returns
SK_RESULT_OK on success, else see Error Code Table
int SK_SETFRAMESYNCDELAY ( int  CamID,
int  linesOfDelay 
)

Sets a delay for FrameSync.

Parameters
CamIDid of camera
linesOfDelaynumber of lines to wait (range: 1 ... 32767)
Returns
SK_RESULT_OK on success, else see Error Code Table
int SK_SETSYNCDIVIDER ( int  CamID,
int  divider 
)

Sets a divider for the trigger clock.

This function sets a divider for the trigger clock at camera I/O input for the external synchronized grabbing in mode 1 and 4 by an integral factor.
The input parameter divider has a range from 1 to 32767.

Example:
divider 1 = Get all lines
divider 2 = Get line at each 2nd trigger
divider 3 = Get line at each 3rd trigger
...

See also
SK_GETSYNCDIVIDERFROMCAMERA
Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
dividerdivider
Returns
SK_RESULT_OK on success, else see Error Code Table
int SK_SETSYNCMODE ( int  CamID,
unsigned char  syncMode 
)

Sets synchronization mode.

This function sets synchronisation mode of camera with CamID. For the synchronization modes exists defines:

1 #define SK_FREERUN 0
2 #define SK_LINESTART 1
3 #define SK_EXPOSURESTART 4
4 #define SK_EXPOSUREACTIVE 5
See also
SK_GETCURRENTSYNCMODE
SK_GETSYNCMODE
SK_GETSYNCMODEFROMCAMERA
Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
syncModesynchronisation mode
Returns
SK_RESULT_OK on success, else see Error Code Table