SK91GigE-WIN  5.5.2
Functions
Startup / Exit

Basics for start and closing down a API session. More...

Functions

int SK_LOADDLL ()
 Initializes data structures. More...
 
int SK_UNLOADDLL ()
 Releasing of internal buffers and structures. More...
 
int SK_INITGIGE (size_t IPAddress, size_t SubnetMask)
 Initialization of IP engine and detection of all connected GigE devices. More...
 
int SK_INITCAMERA (int CamID)
 Initializes the camera. More...
 
int SK_INITCAMERA_SN (int CamID, int SN)
 Initializes the camera with given serial number. More...
 
int SK_CLOSECAMERA (int CamID)
 Disconnects the camera. More...
 
int SK_GETDEVICES (void)
 Returns number of devices. More...
 
LPCTSTR SK_GETDLLVERSION ()
 Returns the version number of the DLL. More...
 
LPCTSTR SK_GETDLLDATE ()
 Returns the build date of the DLL. More...
 
LPCTSTR SK_FOLDEROFSETTINGS (void)
 Returns string with path name. More...
 
int SK_ISCAMERAINIT (int CamID)
 Returns initialization status. More...
 
void SK_SETACTIVE (int CamID, int ActiveStatus)
 Sets camera into active / passive mode. More...
 
int SK_SETCAMID (int newID, int serialNumber)
 Switches the ID of two cameras. More...
 

Detailed Description

Basics for start and closing down a API session.

Note
Before a camera is approachable by the API functions, the DLL and the camera must be successfully initialized.
step 1: SK_LOADDLL
  • SK_LOADDLL has to be called once at the beginning of API session

step 2: SK_INITGIGE
  • After this, the number of connected cameras, the serial number(s), and the camera name(s) can return.
  • Each camera was assigned an ID. The reassignment of a camera to another ID is possible via the serial number.

step 3: SK_INITCAMERA, or SK_INITCAMERA_SN
  • Camera is ready to work now.
  • If desired, in a API session the camera can be closed and initialized multiple times.

Finish the API session:
step n: SK_UNLOADDLL
  • SK_CLOSECAMERA is included, if required to call this.

Example:

// load the DLL
{
// initialization of the GigE interface
// initialization of all connected cameras
for(int i = 0; i < SK_GETDEVICES(); i++)
// do some stuff ...
}
// unload the DLL

Example with reassigment of camera IDs via serial number:

// load the DLL
{
// initialization of the GigE interface
if (SK_GETDEVICES() < 2)
return NotAll;
// set default IDs.
int leftCamID= 0; // at the left side, camera with SN 111
int rightCamID= 1; // at the right side, camera with SN 222
// initialization of left side camera
SK_INITCAMERA_SN( leftCamID, 111);
SK_INITCAMERA_SN( rightCamID, 222);
// do some stuff ...
}
// unload the DLL

Function Documentation

◆ SK_CLOSECAMERA()

int SK_CLOSECAMERA ( int  CamID)

Disconnects the camera.

This function disconnects the camera with the determined camera ID CamID.

By calling SK_UNLOADDLL this function is called automatically for all initialized cameras.

Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
Returns
SK_RESULT_OK on success, else see Error Code Table

◆ SK_FOLDEROFSETTINGS()

LPCTSTR SK_FOLDEROFSETTINGS ( void  )

Returns string with path name.

This function returns a string with the path name where the camera settings will be stored.

Default folder: C:\Users\"username"\AppData\Roaming\SK\SK91GIGE-WIN\Settings

Returns
string with the path name

◆ SK_GETDEVICES()

int SK_GETDEVICES ( void  )

Returns number of devices.

This function returns the number of the connected and detected line scan cameras. The result determines the range of CamID in all functions (CamID = 0 ... n-1)

Returns
number of devices

◆ SK_GETDLLDATE()

LPCTSTR SK_GETDLLDATE ( )

Returns the build date of the DLL.

Returns
date as string

◆ SK_GETDLLVERSION()

LPCTSTR SK_GETDLLVERSION ( )

Returns the version number of the DLL.

Returns
version number as string

◆ SK_INITCAMERA()

int SK_INITCAMERA ( int  CamID)

Initializes the camera.

This function initializes the camera with determined camera ID CamID.

Note
The function has to be called before using the camera the first time or if the cameras was closed during the work.
Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
Returns
SK_RESULT_OK on success, else see Error Code Table

◆ SK_INITCAMERA_SN()

int SK_INITCAMERA_SN ( int  CamID,
int  SN 
)

Initializes the camera with given serial number.

This function initializes the camera with determined serial number SN and gives the camera ID CamID.

Note
The function has to be called before using the camera the first time or if the cameras was closed during the work.
Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
SNserial number of the camera which should be initialized
Returns
SK_RESULT_OK on success, else see Error Code Table

◆ SK_INITGIGE()

int SK_INITGIGE ( size_t  IPAddress,
size_t  SubnetMask 
)

Initialization of IP engine and detection of all connected GigE devices.

Remarks
This function need to call only one time at the program start. The information of all connected cameras will be gathered by the DLL inside. Up to 8 GigE cameras are supported. The number of connected cameras is returned with SK_GETDEVICES(). Other functions can be call with CamID in range of 0 up to SK_GETDEVICES() - 1. The DLL find the type(s) of connected camera(s) automatically and returns the right name with SK_GETCAMTYPE().
Parameters
IPAddressStandard IP address for the cameras
SubnetMaskStandard subnet mask for the cameras
Returns
SK_RESULT_OK on success, else see Error Code Table

◆ SK_ISCAMERAINIT()

int SK_ISCAMERAINIT ( int  CamID)

Returns initialization status.

This function returns the initialization status of the camera with the given camera ID CamID.

Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
Returns
1 = initialized
0 = not initialized
else see Error Code Table

◆ SK_LOADDLL()

int SK_LOADDLL ( )

Initializes data structures.

Note
This function must be called before calling any other function.
Returns
SK_RESULT_OK on success, else see Error Code Table

◆ SK_SETACTIVE()

void SK_SETACTIVE ( int  CamID,
int  ActiveStatus 
)

Sets camera into active / passive mode.

This function sets a connected and initialized camera into active or passive mode.

Remarks
In case of connecting more than one cameras at one PC this function can be used for selecting a defined camera. The other camera(s) should be set passive.
Parameters
CamIDid of camera from 0 ... n - 1, 0 = 1st camera
ActiveStatus0 = passive,
1 = active
Returns
SK_RESULT_OK on success, else see Error Code Table

◆ SK_SETCAMID()

int SK_SETCAMID ( int  newID,
int  serialNumber 
)

Switches the ID of two cameras.

This function is helpful if more than one camera is connected at a PC, and a camera with a special serial number should be assigned a determined ID (0, 1, ..., n-1). The camera IDs will be swapped. The camera, which had previously newID, automatically receives the old camera id.

Parameters
newIDid of camera from 0 ... n - 1, 0 = 1st camera
serialNumberSerial number of camera, which should get the newID
Returns
SK_RESULT_OK on success, else see Error Code Table

◆ SK_UNLOADDLL()

int SK_UNLOADDLL ( )

Releasing of internal buffers and structures.

This function releases the internal buffers and structures. Also, it closes the opened cameras.

If function is not called, memory leaks are the result.

Note
This function has to be called once at program exit.
Returns
SK_RESULT_OK on success, else see Error Code Table