SRAPI|CSharp
 All Classes Namespaces Functions Variables
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
SRAPI_CSharp.SRAPI Class Reference

Classes

class  Constants
 
struct  SR_3DPOINT
 

Public Member Functions

delegate int StatusCB (int sensorId, int msgType, int msgdata1, int msgdata2, string msg)
 
delegate int CBFunc (int sensorId, int dattyp, int startX, int height, int width, ref short[] data)
 
delegate int CBFuncExtData (int sensorId, int dattyp, int startX, int height, int width, ref short[] data, int extDataLen, ref short[] extData)
 
delegate int CBFuncDefaultMode (int sensorId, int dattyp, int startX, int height, int width, ref short[] profile, ref short[] intensity, ref short[] llt, int numExtData, ref int[] extData)
 

Static Public Member Functions

static int getAPIVersion (ref string version)
 function To get the API Version number More...
 
static int getProfileComponents (int dattyp, ref int height, ref int width, ref short[] data, ref short[] profData, ref short[] intensData, ref short[] lltData)
 Splits the data from Scanner into profile, intensity and laser line thickness according to the datatype. More...
 
static int registerUserCB (int CBtype, int command, CBFunc userCB)
 define user callbacks for special functionality More...
 
static int registerUserCB (int CBtype, int command, CBFuncExtData userCB)
 define user callbacks for special functionality More...
 
static int registerUserCB (int CBtype, int command, CBFuncDefaultMode userCB)
 
static int init (StatusCB statuscb)
 function to Initialize the Sensor More...
 
static int connectSensor (string name, string ipAdr, ushort port)
 function adds a New Sensor to be connected More...
 
static int disconnectSensor (string sensorName)
 function adds a Disconnects Sensor More...
 
static int startSensor (int sensorId)
 function to start the Sensor More...
 
static int stopSensor (int sensorId)
 function to stop the Sensor More...
 
static int readCamParsFromFile (string filename)
 read parameterset from file More...
 
static int sendParsToCam (int sensorId)
 sending the parameterset to camera More...
 
static int updateCam (int sensorId, IntPtr filename)
 checks the file extension and startet the appropriate function More...
 
static int changeIp (int sensorId, IntPtr newipadr, ushort newport)
 change IP number More...
 
static int getMACAdr (int sensorId, ref string macAdr)
 read the MAC address from the MPAR More...
 
static int getSerial (int sensorId, ref string serial)
 read the serialnumber from the MPAR More...
 
static int getSwVersion (int sensorId, ref string swVersion)
 read the Software version information of the camera More...
 
static int getHwVersion (int sensorId, ref string hwVersion)
 read the Hardware version information of the camera More...
 
static int getSensorType (int sensorId, ref string partNumber)
 read partnumber to identify the sensor type More...
 
static int getSensorSize (int sensorId, ref int width, ref int height)
 read size of the imager More...
 
static int getSensorCenterPosition (int sensorId, ref int centerX, ref int centerY)
 read the center position of the sensor More...
 
static int setLaser (int sensorId, int pulse_mode, int external_mode, int enable, int power)
 configure the laser 2010-11-08: int power (0..100[%]) hinzu More...
 
static int setOutput (int sensorId, int channel, int val)
 set the digital output of the camera More...
 
static int getInput (int sensorId, int channel, ref int val)
 get input status from the camera More...
 
static int setExposure (int sensorId, int enableDoubleExpo, int expo_small, int expo_large)
 configure the exposure module and send it to cam More...
 
static int setTrigger (int sensorId, int mode, int source, int edge, int outputselect, int trigfrq, int trigcnt, int trigoffset)
 configure the trigger module and send it to camera More...
 
static int setImager (int sensorId, int startx, int starty, int width, int height, int gainEnable, int gain)
 configure the CMOS module and send it to camera More...
 
static int getImager (int sensorId, ref int startx, ref int starty, ref int width, ref int height, ref int gainEnable, ref int gain)
 read the CMOS module from the loaded parameterset More...
 
static int getExposure (int sensorId, ref int enableDoubleExpo, ref int expo_small, ref int expo_large)
 read the exposure module from the loaded parameterset More...
 
static int getTrigger (int sensorId, ref int mode, ref int source, ref int edge, ref int outputselect, ref int trigfrq, ref int trigcnt, ref int trigoffset)
 read the trigger module from the loaded parameterset More...
 
static int createWorldData (int sensorId, int startX, int width, IntPtr profil, ref SR_3DPOINT[] world)
 create WorldCoordinates with LUT in SR_3DPOINT.float More...
 
static int remapWorldToMatrix (ref SR_3DPOINT[] world, ref short[] intens, int len, float range_start, float range_end, ref short[] iS, ref short[] zS, float offsetZ, float scaleZ)
 remapping the world coordinates in to a matrix and keep z-world and y-world Erst wird zu WeltZ der offsetZ addiert, das Ergebnis wird dann mit scaleZ multipliziert More...
 
static int WorldToImage (int sensorId, ref SR_3DPOINT point, ref int imgX, ref int imgY)
 convert world points in to image points More...
 
static int readLutInfoFile (int sensorId, IntPtr DateiPfad, IntPtr infoLut)
 read the LUT information from file More...
 
static int loadLutFromFile (int sensorId, String DateiPfad)
 load a LUT form file More...
 
static int getErrorString (int error_code, ref string error_string)
 Create an error string out of a error code. More...
 
static int GetParamProfile (int sensorId, ref int packetSize, ref int numOfProfiles)
 Get values from the GetNextLine & SendTCP module and send it to camera. More...
 
static int SetParamProfile (int sensorId, int packetSize, int numOfProfiles)
 Set the GetNextLine & SendTCP module and send it to camera. More...
 
static int getSensorName (int sensorId, ref string productName)
 Get the Sensor Factory Name. More...
 
static int getCamIndex (int sensorId)
 function gets the index of the sensor w.r.t sensorId More...
 
static int getName (int sensorId, ref string name)
 function gets the name of the sensor entered by the user for the corresponding sensorId More...
 
static int getIp (int sensorId, ref string ipAdr)
 function gets the IP of the sensor w.r.t sensorId More...
 
static int getPortNum (int sensorId)
 function gets the port number of the sensor w.r.t sensorId More...
 
static int getConnectionState (int sensorId)
 function gets the connection state of the sensor More...
 
static int getLaserEnableStatus (int sensorId)
 function gets the laser Enable status (enable/disable) of the sensor More...
 
static int getLaserLightStatus (int sensorId)
 function gets the laserlight status (on/off) of the sensor More...
 
static int getFps (int sensorId)
 function gets the framerate of the sensor More...
 
static int getTps (int sensorId)
 function gets the Triggerrate of the sensor More...
 
static float getTemp (int sensorId)
 function retrieves the Temperature of the sensor More...
 
static int isRunning (int sensorId)
 function checks if the sensor is alive More...
 

Static Public Attributes

static CBFunc m_userCbf1
 
static CBFuncExtData m_userCbfextd1
 
static CBFuncDefaultMode m_userCbfdefault
 

Member Function Documentation

static int SRAPI_CSharp.SRAPI.changeIp ( int  sensorId,
IntPtr  newipadr,
ushort  newport 
)
static

change IP number

Parameters
sensorId- Unique id of the connected sensor
newip- pointer to the byte array which stores the new IP address
newport- new port number on which camera should listen
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NO_SYSPAR_AVAILABLE - selected camera is not available
ERR_IP_OR_PORT_IS_ZERO - newport or new IP are zero
ERR_IP_IS_BROADCAST - newip contain 4 times the value 255
See Also
SR_API_CommandSend
static int SRAPI_CSharp.SRAPI.connectSensor ( string  name,
string  ipAdr,
ushort  port 
)
static

function adds a New Sensor to be connected

Parameters
sensorNamemust be a unique name to identify the sensor to connect
ipAdrthe ip4 Ip Address of the sensor to connect
portthe portnumber of the sensor to connect
Returns
id of the added sensor or a negative error code if something went wrong
ERR_FUNCTION_NOT_SUCCESSFUL
static int SRAPI_CSharp.SRAPI.createWorldData ( int  sensorId,
int  startX,
int  width,
IntPtr  profil,
ref SR_3DPOINT[]  world 
)
static

create WorldCoordinates with LUT in SR_3DPOINT.float

Parameters
sensorId- Unique id of the connected sensor
startX- start position in x direction
width- width of the profile
profil- pointer for the storage of the profiles, profiles has a 14 bit width
world- pointer for the storage of the world coordinates as X,Y,Z Tupel
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NULLPOINTER - pointer of the storage of the profiles is a nullpointer
ERR_NULLPOINTER - pointer of the storage of the world coordinates is a nullpointer
ERR_NULLPOINTER - LUT of the camera is a nullpointer
ERR_OUT_OF_RANGE - startX and the width is greater than the LUT width
-6 - index of the LUT is not valid
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.disconnectSensor ( string  sensorName)
static

function adds a Disconnects Sensor

Parameters
sensorNamemust be a unique name to identify the sensor to connect
ipAdrthe ip4 Ip Address of the sensor to connect
portthe portnumber of the sensor to connect
Returns
id of the added sensor or a negative error code if something went wrong
ERR_FUNCTION_NOT_SUCCESSFUL
static int SRAPI_CSharp.SRAPI.getAPIVersion ( ref string  version)
static

function To get the API Version number

Parameters
version- API Version Number String
Returns
SUCCESS
static int SRAPI_CSharp.SRAPI.getCamIndex ( int  sensorId)
static

function gets the index of the sensor w.r.t sensorId

Parameters
sensorIdmust be a unique id to identify the sensor
Returns
ERR_TOO_MANY_NR_OF_CAM_INSTANCES
SUCCESS
ERR_CD_NULLPOINTER
static int SRAPI_CSharp.SRAPI.getConnectionState ( int  sensorId)
static

function gets the connection state of the sensor

Parameters
sensorIdmust be a unique id to identify the sensor
Returns
ERR_TOO_MANY_NR_OF_CAM_INSTANCES
SUCCESS
ERR_CD_NULLPOINTER
CAMERA_CONNECTED
static int SRAPI_CSharp.SRAPI.getErrorString ( int  error_code,
ref string  error_string 
)
static

Create an error string out of a error code.

Parameters
error_code- error code for which we want to generate an error string
error_string- string for the converted errorcode
Returns
SUCCESS
ERR_NULLPOINTER - Invalid character poiner address
static int SRAPI_CSharp.SRAPI.getExposure ( int  sensorId,
ref int  enableDoubleExpo,
ref int  expo_small,
ref int  expo_large 
)
static

read the exposure module from the loaded parameterset

Parameters
sensorId- Unique id of the connected sensor
*enableDoubleExpo- enable double exposure
*enableCtrlSmall- enable the short exposure time
*enableCtrlLarge- enable the large exposure time
*expo_small- time of the short exposure time in microseconds
*expo_large- time of the large exposure time in microseconds
Returns
0 - successful
static int SRAPI_CSharp.SRAPI.getFps ( int  sensorId)
static

function gets the framerate of the sensor

Parameters
sensorIdmust be a unique id to identify the sensor
Returns
ERR_TOO_MANY_NR_OF_CAM_INSTANCES
SUCCESS
ERR_CD_NULLPOINTER
static int SRAPI_CSharp.SRAPI.getHwVersion ( int  sensorId,
ref string  hwVersion 
)
static

read the Hardware version information of the camera

Parameters
sensorId- Unique id of the connected sensor
hwVersion- hardware version string
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NO_MPAR_AVAILABLE - no MPAR for the selected camera available
ERR_NULLPOINTER - version_sw is a nullpointer
ERR_NULLPOINTER - version_hw is a nullpointer
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.getImager ( int  sensorId,
ref int  startx,
ref int  starty,
ref int  width,
ref int  height,
ref int  gainEnable,
ref int  gain 
)
static

read the CMOS module from the loaded parameterset

Parameters
sensorId- Unique id of the connected sensor
*startx- start position of the ROI in x direction
*starty- start position of the ROI in y direction
*width- width of the ROI
*height- height of the ROI
*gainEnable- enable the gain of the CMOS imager
*gain- configure the gain of the imager
Returns
0 - successful -1 - no parameter file loaded -2 - inst out of range 0..1
static int SRAPI_CSharp.SRAPI.getInput ( int  sensorId,
int  channel,
ref int  val 
)
static

get input status from the camera

this will be done only local from API because the information will be update every 200ms via the alive signal

Parameters
sensorId- Unique id of the connected sensor
channel- selected channel
val- pointer for the storage of the selected channel status
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NULLPOINTER - val is a nullpointer
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.getIp ( int  sensorId,
ref string  ipAdr 
)
static

function gets the IP of the sensor w.r.t sensorId

Parameters
sensorId- must be a unique id to identify the sensor
ipAdr- IPAddress String
Returns
ERR_TOO_MANY_NR_OF_CAM_INSTANCES
SUCCESS
ERR_CD_NULLPOINTER
static int SRAPI_CSharp.SRAPI.getLaserEnableStatus ( int  sensorId)
static

function gets the laser Enable status (enable/disable) of the sensor

Parameters
sensorIdmust be a unique id to identify the sensor
Returns
ERR_TOO_MANY_NR_OF_CAM_INSTANCES
SUCCESS
ERR_CD_NULLPOINTER
static int SRAPI_CSharp.SRAPI.getLaserLightStatus ( int  sensorId)
static

function gets the laserlight status (on/off) of the sensor

Parameters
sensorIdmust be a unique id to identify the sensor
Returns
ERR_TOO_MANY_NR_OF_CAM_INSTANCES
SUCCESS
ERR_CD_NULLPOINTER
static int SRAPI_CSharp.SRAPI.getMACAdr ( int  sensorId,
ref string  macAdr 
)
static

read the MAC address from the MPAR

Parameters
sensorId- Unique id of the connected sensor
macAdr- MAC address string
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NO_MPAR_AVAILABLE - no MPAR for the selected camera available
ERR_NULLPOINTER - mac is a nullpointer
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.getName ( int  sensorId,
ref string  name 
)
static

function gets the name of the sensor entered by the user for the corresponding sensorId

Parameters
sensorId- must be a unique id to identify the sensor
name- Sensor name string
Returns
ERR_TOO_MANY_NR_OF_CAM_INSTANCES
SUCCESS
ERR_CD_NULLPOINTER
static int SRAPI_CSharp.SRAPI.GetParamProfile ( int  sensorId,
ref int  packetSize,
ref int  numOfProfiles 
)
static

Get values from the GetNextLine & SendTCP module and send it to camera.

Parameters
sensorId- Unique id of the connected sensor
inst- instance of module
packetSize- number of profile lines to transmit
numProfiles- stop sensor after this number of profile lines are generated / if 0 (zero) we run continuously
Returns
SUCCESS - successful ERR_PARAMETERFILE_NOT_FOUND - Parameters not loaded from file ERR_TOO_MANY_NR_OF_CAM_INSTANCES - inst out of range 0..3
static int SRAPI_CSharp.SRAPI.getPortNum ( int  sensorId)
static

function gets the port number of the sensor w.r.t sensorId

Parameters
sensorIdmust be a unique id to identify the sensor
Returns
ERR_TOO_MANY_NR_OF_CAM_INSTANCES
SUCCESS
ERR_CD_NULLPOINTER
static int SRAPI_CSharp.SRAPI.getProfileComponents ( int  dattyp,
ref int  height,
ref int  width,
ref short[]  data,
ref short[]  profData,
ref short[]  intensData,
ref short[]  lltData 
)
static

Splits the data from Scanner into profile, intensity and laser line thickness according to the datatype.

Convertion function is valid only for the scanner configured in profile mode

Parameters
dattyp- datatype of the callback function
height- Height of the profile scan (or total number of profiles captured in each scan as per configuration)
width- width of each profile scan
data- the data in the scanned profile
profData- Reference for the profile data
intensData- Reference for the intensity data
lltData- Reference for the laser line thickness data
Returns
ERR_WIDTH_IS_ZERO - Width is null
ERR_HEIGHT_IS_ZERO - Height is null
ERR_WRONG_DATTYPE - Datatype Invalid
SUCCESS - successful
datatype - Constants.DATATYPE_PROFILE, Constants.DATATYPE_INTENSITY or Constants.DATATYPE_PROFILE_PLUS_INTENSITY
static int SRAPI_CSharp.SRAPI.getSensorCenterPosition ( int  sensorId,
ref int  centerX,
ref int  centerY 
)
static

read the center position of the sensor

Parameters
sensorId- Unique id of the connected sensor
centerX- reference of the midview of the X-axis
centerY- reference of the midview of the Y-axis
Returns
ERR_CENTERX_RANGE_ERROR - centerX is not between 0 and 1280
ERR_CENTERY_RANGE_ERROR - centerY is not between 0 and 1280
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NULLPOINTER - centerX is a nullpointer
ERR_NULLPOINTER - centerY is a nullpointer
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.getSensorName ( int  sensorId,
ref string  productName 
)
static

Get the Sensor Factory Name.

Parameters
sensorId- Unique id of the connected sensor
productName- Factory name of the selected 3D Sensor
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NULLPOINTER - Product name passed is a nullpointer
SUCCESS
static int SRAPI_CSharp.SRAPI.getSensorSize ( int  sensorId,
ref int  width,
ref int  height 
)
static

read size of the imager

ToDo!!! idealerweise aus Kamera bzw. Maschinenpar

Parameters
sensorId- Unique id of the connected sensor
width- reference for the storage of the imager width
height- reference for the storage of the imager height
Returns
ERR_WIDTH_IS_ZERO - width is zero
ERR_HEIGHT_IS_ZERO - height is zero
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.getSensorType ( int  sensorId,
ref string  partNumber 
)
static

read partnumber to identify the sensor type

Parameters
sensorId- Unique id of the connected sensor
partNumber- stores the partnumber of the sensor
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NULLPOINTER - partNumber is a nullpointer
ERR_NO_MPAR_AVAILABLE - selected camera is not avaialbe
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.getSerial ( int  sensorId,
ref string  serial 
)
static

read the serialnumber from the MPAR

Parameters
sensorId- Unique id of the connected sensor
serial- serial number string
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NO_MPAR_AVAILABLE - no MPAR for the selected camera available
ERR_NULLPOINTER - serial is a nullpointer
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.getSwVersion ( int  sensorId,
ref string  swVersion 
)
static

read the Software version information of the camera

Parameters
sensorId- Unique id of the connected sensor
swVersion- software version string
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NO_MPAR_AVAILABLE - no MPAR for the selected camera available
ERR_NULLPOINTER - version_sw is a nullpointer
ERR_NULLPOINTER - version_hw is a nullpointer
SUCCESS - successful
static float SRAPI_CSharp.SRAPI.getTemp ( int  sensorId)
static

function retrieves the Temperature of the sensor

Parameters
sensorIdmust be a unique id to identify the sensor
Returns
ERR_TOO_MANY_NR_OF_CAM_INSTANCES
SUCCESS
ERR_CD_NULLPOINTER
static int SRAPI_CSharp.SRAPI.getTps ( int  sensorId)
static

function gets the Triggerrate of the sensor

Parameters
sensorIdmust be a unique id to identify the sensor
Returns
ERR_TOO_MANY_NR_OF_CAM_INSTANCES
SUCCESS
ERR_CD_NULLPOINTER
static int SRAPI_CSharp.SRAPI.getTrigger ( int  sensorId,
ref int  mode,
ref int  source,
ref int  edge,
ref int  outputselect,
ref int  trigfrq,
ref int  trigcnt,
ref int  trigoffset 
)
static

read the trigger module from the loaded parameterset

Parameters
sensorId- Unique id of the connected sensor
*mode- set the trigger mode 0 - free running 1 - intern 2 - extern 3 - extern In 0 enabled 4 - In 0 enabled
*source- set the trigger source 0 - In 1 1 - In 2 2 - both 3 - intern (TTL) 4 - quad
*edge- on which edge should be trigger 0 - rising 1 - falling 2 - both
*outputselect-
  • Out0 = bit[0]
  • Out1 = bit[1]
*trigfrq- frequency of the trigger
*trigcnt- count of suppressed trigger (trigger divider)
*trigoffset- number of suppressed trigger after start camera
Returns
0 - successful -1 - no parameter file loaded -2 - inst out of range 0
static int SRAPI_CSharp.SRAPI.init ( StatusCB  statuscb)
static

function to Initialize the Sensor

Parameters
userCB_StatusMessagecall back status message
See Also
SR_API_Init
static int SRAPI_CSharp.SRAPI.isRunning ( int  sensorId)
static

function checks if the sensor is alive

Parameters
sensorIdmust be a unique id to identify the sensor
Returns
ERR_TOO_MANY_NR_OF_CAM_INSTANCES
SUCCESS
ERR_CD_NULLPOINTER
static int SRAPI_CSharp.SRAPI.loadLutFromFile ( int  sensorId,
String  DateiPfad 
)
static

load a LUT form file

Parameters
sensorId- Unique id of the connected sensor
DateiPfad- path of the LUT
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NULLPOINTER - DateiPfad is a nullpointer
ERR_NULLPOINTER - info is a nullpointer
ERR_SIZE_MISSMATCH - header size is to small
ERR_CAM_NOT_CONNECTED - no information of the imager size
ERR_CAM_NOT_CONNECTED - wrong imager width
ERR_CAM_NOT_CONNECTED - wrong imager height
ERR_ALLOCATION_FAILED - allocate memory for the LUT failed
ERR_SIZE_MISSMATCH - data size to small
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.readCamParsFromFile ( string  filename)
static

read parameterset from file

Parameters
filename- path to the file which should be read
Returns
ERR_FILE_NOT_READ - file couldn't be read
ERR_SIZE_MISSMATCH - size of the read file doesn't match with the expected size
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.readLutInfoFile ( int  sensorId,
IntPtr  DateiPfad,
IntPtr  infoLut 
)
static

read the LUT information from file

Parameters
sensorId- Unique id of the connected sensor
DateiPfad- path of the LUT
info- pointer of the storage for the read LUT information
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NULLPOINTER - DateiPfad is a nullpointer
ERR_NULLPOINTER - info is a nullpointer
ERR_READ_FILE_FAILED - reading of the LUT information failed
ERR_FILE_NEVER_FOUND - no file found
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.registerUserCB ( int  CBtype,
int  command,
CBFunc  userCB 
)
static

define user callbacks for special functionality

Parameters
CBtype- type of the callback function
command- command which should be send from the callback
userCB- pointer to the callback function which should called
Returns
ERR_NR_USERCB_RAWDATA_MAX - numUserCB_RawData is equal to MAXNUM_SRCB_RAWDATA
ERR_NR_USERCB_CAMDATA_MAX - numUserCB_CamData is equal to MAXNUM_SRCB_CAMDATA
ERR_NR_USERCB_CAMDATAEXT_MAX - numUserCB_DataExt is equal to MAXNUM_SRCB_CAMDATAEXT
ERR_NR_USERCB_PIXELMODE_MAX - numUserCB_PixelMode is equal to MAXNUM_SRCB_PIXELMODE
ERR_NO_VALID_CB_TYPE - no valid CBtype
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.registerUserCB ( int  CBtype,
int  command,
CBFuncExtData  userCB 
)
static

define user callbacks for special functionality

Parameters
CBtype- type of the callback function
command- command which should be send from the callback
userCB- pointer to the callback function which should called
Returns
ERR_NR_USERCB_RAWDATA_MAX - numUserCB_RawData is equal to MAXNUM_SRCB_RAWDATA
ERR_NR_USERCB_CAMDATA_MAX - numUserCB_CamData is equal to MAXNUM_SRCB_CAMDATA
ERR_NR_USERCB_CAMDATAEXT_MAX - numUserCB_DataExt is equal to MAXNUM_SRCB_CAMDATAEXT
ERR_NR_USERCB_PIXELMODE_MAX - numUserCB_PixelMode is equal to MAXNUM_SRCB_PIXELMODE
ERR_NO_VALID_CB_TYPE - no valid CBtype
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.remapWorldToMatrix ( ref SR_3DPOINT[]  world,
ref short[]  intens,
int  len,
float  range_start,
float  range_end,
ref short[]  iS,
ref short[]  zS,
float  offsetZ,
float  scaleZ 
)
static

remapping the world coordinates in to a matrix and keep z-world and y-world Erst wird zu WeltZ der offsetZ addiert, das Ergebnis wird dann mit scaleZ multipliziert

Version: 1.1.0 2011-01-20 scaleZ ist nun 1/scaleZ.alt also 0.010 statt 100 eintragen index_last wird beim Lücke suchen auch inkremetiert !! 2011-01-20: TA damit sind Fehlfunktionen des Remappers (bis neue gefunden) eliminiert

Parameters
srw- world coordinates
intens- intensity array after the separation in profils and intensity from the camera
len- length of the world coordinates which is equal to the number of intensity data
range_start- start position for the remapping of the world coordinates
range_end- end position for the remapping of the world coordinates
iS- pointer to store the intensity data after remapping
zS- pointer to store the z coordinates after remapping
offsetZ- offset from z for the storage of the world into 16 bit
scaleZ- scale of the z direction for example 0.01 => zW in mm –> 1/100 == 10um resolution
Returns
ERR_VAL_LESS_THAN_ZERO - len is zero or less
ERR_VAL_GREATER_THAN_MAX - len is greater than MAXREMAPDATALEN
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.sendParsToCam ( int  sensorId)
static

sending the parameterset to camera

Parameters
sensorId- Unique id of the connected sensor
Returns
Errorcode cd is a nullpointer - "no camera object"
See Also
SR_API_GetErrorString
static int SRAPI_CSharp.SRAPI.setExposure ( int  sensorId,
int  enableDoubleExpo,
int  expo_small,
int  expo_large 
)
static

configure the exposure module and send it to cam

Parameters
sensorId- Unique id of the connected sensor
enableDoubleExpo- enable double exposure
enableCtrlSmall- enable the short exposure time
enableCtrlLarge- enable the large exposure time
expo_small- time of the short exposure time in microseconds
expo_large- time of the large exposure time in microseconds
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
See Also
SR_API_CommandSend
static int SRAPI_CSharp.SRAPI.setImager ( int  sensorId,
int  startx,
int  starty,
int  width,
int  height,
int  gainEnable,
int  gain 
)
static

configure the CMOS module and send it to camera

Parameters
sensorId- Unique id of the connected sensor
startx- start position of the ROI in x direction
starty- start position of the ROI in y direction
width- width of the ROI
height- height of the ROI
gainEnable- enable the gain of the CMOS imager
gain- configure the gain of the imager
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_GAIN_RANGE - gain is not between 0 and 15
ERR_VAL_LESS_THAN_ZERO - starty, startx, width or height is less than zero
ERR_RANGE_CHECK - step size in x direction of the imager and the startx position or the width of the ROI have a mismatch
ERR_RANGE_CHECK - imager width and the sum of start position and width of the ROI have a mismatch
See Also
SR_API_CommandSend
static int SRAPI_CSharp.SRAPI.setLaser ( int  sensorId,
int  pulse_mode,
int  external_mode,
int  enable,
int  power 
)
static

configure the laser 2010-11-08: int power (0..100[%]) hinzu

Parameters
sensorId- Unique id of the connected sensor
laser_mode- select the mode of the laser 0 - pulse 1 - continous
laser_on_select- control with software or hardware 0 - software 1 - soft+extern
enable- enable oder disable the laser
power- power of the laser, values between 0 and 100%
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
See Also
SR_API_CommandSend
static int SRAPI_CSharp.SRAPI.setOutput ( int  sensorId,
int  channel,
int  val 
)
static

set the digital output of the camera

Parameters
sensorId- Unique id of the connected sensor
channel- select the channel which should be configure
val- value to which the selected channel should be set
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
See Also
SR_API_CommandSend
static int SRAPI_CSharp.SRAPI.SetParamProfile ( int  sensorId,
int  packetSize,
int  numOfProfiles 
)
static

Set the GetNextLine & SendTCP module and send it to camera.

Parameters
cd- camera descriptor of the selected camera
inst- instance of module
packetSize- number of profile lines to transmit
numProfiles- stop sensor after this number of profile lines are generated / if 0 (zero) we run continuously
Returns
SUCCESS - successful ERR_PARAMETERFILE_NOT_FOUND - Parameters not loaded from file ERR_TOO_MANY_NR_OF_CAM_INSTANCES - inst out of range 0..3
static int SRAPI_CSharp.SRAPI.setTrigger ( int  sensorId,
int  mode,
int  source,
int  edge,
int  outputselect,
int  trigfrq,
int  trigcnt,
int  trigoffset 
)
static

configure the trigger module and send it to camera

Parameters
cd- camera descriptor of the selected camera
mode- set the trigger mode 0 - free running 1 - intern 2 - extern 3 - extern In 0 enabled 4 - In 0 enabled
source- set the trigger source 0 - In 1 1 - In 2 2 - both 3 - intern (TTL) 4 - quad
edge- on which edge should be trigger 0 - rising 1 - falling 2 - both
outputselect-
  • Out0 = bit[0]
  • Out1 = bit[1]
trigfrq- frequency of the trigger
trigcnt- count of suppressed trigger (trigger divider)
trigoffset- number of suppressed trigger after start camera
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
See Also
SR_API_CommandSend
static int SRAPI_CSharp.SRAPI.startSensor ( int  sensorId)
static

function to start the Sensor

Parameters
sensorId: Unique id for the sensor
Returns
ERR_CD_NULLPOINTER
SUCCESS
See Also
SR_API_StartCam
static int SRAPI_CSharp.SRAPI.stopSensor ( int  sensorId)
static

function to stop the Sensor

Parameters
sensorId: Unique id for the sensor
Returns
ERR_CD_NULLPOINTER
SUCCESS
See Also
SR_API_StopCam
static int SRAPI_CSharp.SRAPI.updateCam ( int  sensorId,
IntPtr  filename 
)
static

checks the file extension and startet the appropriate function

Parameters
sensorId- Unique id of the connected sensor
FileName- filename of the file which should update the camera
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NULLPOINTER - FileName is a nullpointer
ERR_INVALID_FILENAME - invalid filename
ERR_INVALID_FILETYPE - camera doesn't match with the update file type
ERR_INVALID_UPDATEFILE - file is not a smartray update file
SUCCESS - successful
static int SRAPI_CSharp.SRAPI.WorldToImage ( int  sensorId,
ref SR_3DPOINT  point,
ref int  imgX,
ref int  imgY 
)
static

convert world points in to image points

Version : 1.01 Convert a WorldPoint (float) into a nearest Imager Position with use of the LUT (no Subpixeling) We use a iteration to find the img. Point !! We limit the databuswidth to 10bit !! because we do not use subpix !! so the max ImagerHeight is 1024 pix !!* Input: Wordcoordinate as X, Y,Z Tupel (X is not used) just ONE point! Output: Corresponding Imager Coordinate to the given World Point

Parameters
cd- camera descriptor of the selected camera
world- world coordinates we want to convert
imgX- pointer for the storage of the image x coordinats
imgY- pointer for the storage of the image y coordinats
Returns
ERR_CD_NULLPOINTER - camera descriptor is a nullpointer
ERR_NULLPOINTER - world is a nullpointer
ERR_NULLPOINTER - imgX is a nullpointer
ERR_NULLPOINTER - imgY is a nullpointer
ERR_FUNCTION_NOT_SUCCESSFUL - no success
ERR_NO_IMAGE_POINT_FOUND - image point found
ERR_NULLPOINTER - LUT of the camera is a nullpointer
ERR_LUTWIDTH_IS_ZERO - LUTWidth is zero
ERR_LUTHEIGHT_IS_ZERO - LUTHeight is zero
SUCCESS - successful