JCam DLL API Reference
Configuring Calibration, IP Address, and Cable ID

Functions

int jsReadOldPositionCalibrationsN (JCONNECTION const jc, jsLaserIndex const laserIndex, jsOldCalibrationValue oldCalibrations[], UINT32 nCalibrations)
 Reads the specified number of old position calibrations for the selected laser from the scanner. More...
 
int jsOverrideLaserAutoexposure (JCONNECTION const jc, double minLaserOn, double maxLaserOn, double defaultLaserOn, int staturatedIntensity, int saturatedPercentage, int laserThreshold, bool autoexposeLaser)
 Override the Laser Autoexposure parameters set in param.dat. Values will be lost when a new param.dat file is loaded, or when the head restarts. Must be called for each scanner that you wish the values to apply to. More...
 
int jsOverrideScanWindow (JCONNECTION const jc, double windowTop, double windowBottom, double windowLeft, double windowRight)
 Override the Scan Window parameters set in param.dat. Values will be lost when a new param.dat file is loaded, or when the head restarts. Must be called for each scanner that you wish the values to apply to. More...
 
int jsOverrideSyncSettings (JCONNECTION const jc, double timeScannedInterval, double encoderPulseInterval, double encoderScanInterval, int numberOfPhases, bool timeStaggeredScanning, double laser0Phase, double laser1Phase, double laser2Phase, double laser3Phase, double laser4Phase, bool untriggeredSyncScanning, bool startScanRisingEdgeTriggered)
 Override the Synchronized Scanning parameters set in param.dat. Values will be lost when a new param.dat file is loaded, or when the head restarts. Must be called for each scanner that you wish the values to apply to. More...
 
int jsReadScanWindowN (JCONNECTION const jc, jsLaserIndex const laserIndex, int *top, int *bottom, int *left, int *right)
 Reads the current scan window for the selected laser from the scanner. More...
 
int jsReadPositionCalibrationN (JCONNECTION const jc, jsLaserIndex const laserIndex, double *xOffset, double *yOffset, double *roll)
 Reads the current position calibration for the selected laser from the scanner. More...
 
int jsSendPositionCalibrationN (JCONNECTION const jc, jsLaserIndex const laserIndex, double const xOffset, double const yOffset, double const roll)
 Sends a position calibration for the selected laser to the scanner. More...
 
int jsSetStaticIpInt (UINT32 const serialNumber, UINT32 const staticIpAddress, UINT32 const netmask)
 Sets a scanner's static IP address. More...
 
int jsSetStaticIpChar (UINT32 const serialNumber, char const *const staticIpAddress, char const *const netmask)
 Sets a scanner's static IP address. More...
 
int jsSetBaseIpInt (UINT32 const serialNumber, UINT32 const baseIpAddress, UINT32 const netmask)
 Sets a scanner's base IP address. More...
 
int jsSetBaseIpChar (UINT32 const serialNumber, char const *const baseIpAddress, char const *const netmask)
 Sets a scanner's base IP address. More...
 
int jsSetCableId (UINT32 const serialNumber, UINT32 const cableId)
 Overrides the cable ID physically wired into a scanner. More...
 
int jsClearCableId (UINT32 const serialNumber)
 Reverts to the cable ID physically wired into a scanner. More...
 

Detailed Description

Function Documentation

◆ jsClearCableId()

int jsClearCableId ( UINT32 const  serialNumber)

Reverts to the cable ID physically wired into a scanner.

If the scanner is set to use Base+IP addressing, the scanner's IP address will change according to the new IP address.

See also
jsSetCableId()
Parameters
serialNumberThe serial number of the scanner to change.
Returns
0 on success.
INVALID_PARAMETER cableId is over 31.
-1 on all other failures.

◆ jsOverrideLaserAutoexposure()

int jsOverrideLaserAutoexposure ( JCONNECTION const  jc,
double  minLaserOn,
double  maxLaserOn,
double  defaultLaserOn,
int  staturatedIntensity,
int  saturatedPercentage,
int  laserThreshold,
bool  autoexposeLaser 
)

Override the Laser Autoexposure parameters set in param.dat. Values will be lost when a new param.dat file is loaded, or when the head restarts. Must be called for each scanner that you wish the values to apply to.

Parameters
jcThe connection to the scanner.
minLaserOnThe minimum length of time the laser will turn on. Units milliseconds. Range 0.01 - 650.0. Default 0.01.
maxLaserOnThe maximum length of time the laser will turn on. Units milliseconds. Range 0.01 - 650.0. Default 5.0.
defaultLaserOnWhen too few points are found, the laser on time will revert to this default value. Units milliseconds. Range 0.01 - 650.0. Default average of min and max
saturatedIntensityThis is how bright a data point must be to be considered saturated. If over saturatedPercentage of the data points are allowed to have a brightness over this level. Range 0 - 1023. Default 800.
saturatedPercentagedThe percentage of found points that the scanner will attempt to keep over saturatedIntensity. Range 1 - 100. Default 30.
laserThresholdA point must be at least laserThreshold brightness to be detect a laser point. Range 0 - 1023. Default 120.
autoExposeLaserEnable laser autoexposure if true.
Returns
0 on success.
INVALID_PARAMETER if jc NULL or if any of the settings parameters are invalid.
SCANNER_FAILURE on all connection failures.

◆ jsOverrideScanWindow()

int jsOverrideScanWindow ( JCONNECTION const  jc,
double  windowTop,
double  windowBottom,
double  windowLeft,
double  windowRight 
)

Override the Scan Window parameters set in param.dat. Values will be lost when a new param.dat file is loaded, or when the head restarts. Must be called for each scanner that you wish the values to apply to.

Parameters
jcThe connection to the scanner.
windowTopPoints with Y values greater than this will be ignored
windowBottomPoints with Y values less than this will be ignored
windowLeftPoints with X values less than this will be ignored
windowRightPoints with X values greater than this will be ignored
Returns
0 on success.
INVALID_PARAMETER if jc NULL or if any of the settings parameters are invalid.
SCANNER_FAILURE on all connection failures.

◆ jsOverrideSyncSettings()

int jsOverrideSyncSettings ( JCONNECTION const  jc,
double  timeScannedInterval,
double  encoderPulseInterval,
double  encoderScanInterval,
int  numberOfPhases,
bool  timeStaggeredScanning,
double  laser0Phase,
double  laser1Phase,
double  laser2Phase,
double  laser3Phase,
double  laser4Phase,
bool  untriggeredSyncScanning,
bool  startScanRisingEdgeTriggered 
)

Override the Synchronized Scanning parameters set in param.dat. Values will be lost when a new param.dat file is loaded, or when the head restarts. Must be called for each scanner that you wish the values to apply to.

Parameters
jcThe connection to the scanner.
timeScannedIntervalThe time interval in seconds between scans in TimeSyncMode. Range 0.0 to 167.7. Default 0.01.
encoderPulseIntervalDistance between encoder puleses in EncoderSyncMode (Full quadrature, typically 4x the specified pulses per revolution). default 1.0.
encoderScanIntervalDistance between scans in EncoderSyncMode. Must be greater than the encoderPulseInterval (ideally 100X or more) default 1.0.
numberOfPhasesIf timeStaggeredScanning is false then delay between 0.0 and 1.0 of the entire encoderScanInterval. Default 2.
timeStaggeredScanningIf true this scanner will stagger based on a fixed time delay. Default false.
laser0PhaseIf timeStaggered scanning is true, then this laser will delay timeStaggerDelay ms after the encoder, or PulseMaster trigger. otherwise the scanner will fire in the laser0Phase encoder phase.
laser1PhaseIf timeStaggered scanning is true, then this laser will delay timeStaggerDelay ms after the encoder, or PulseMaster trigger. otherwise the scanner will fire in the laser0Phase encoder phase.
laser2PhaseIf timeStaggered scanning is true, then this laser will delay timeStaggerDelay ms after the encoder, or PulseMaster trigger. otherwise the scanner will fire in the laser0Phase encoder phase.
laser3PhaseIf timeStaggered scanning is true, then this laser will delay timeStaggerDelay ms after the encoder, or PulseMaster trigger. otherwise the scanner will fire in the laser0Phase encoder phase.
laser4PhaseIf timeStaggered scanning is true, then this laser will delay timeStaggerDelay ms after the encoder, or PulseMaster trigger. otherwise the scanner will fire in the laser0Phase encoder phase.
untriggeredSyncScanningIf true then the scanner won't wait for a start scan signal trigger, and instead start scanning immediately upon receiving the jsEnterEncoderSyncMode() or jsEnterTimeSyncMode(). Default false. This is not a reliable technique for multiple scanner systems if they enter scanning while the encoder is moving, because there may be a substantial difference between when various scanners receive the enter sync mode command.
startScanRisingEdgeTriggeredIf true scanning will start on the rising edge of the start scan signal, otherwise on the falling edge. Default false.
Returns
0 on success.
INVALID_PARAMETER if jc NULL or if any of the settings parameters are invalid.
SCANNER_FAILURE on all connection failures.

◆ jsReadOldPositionCalibrationsN()

int jsReadOldPositionCalibrationsN ( JCONNECTION const  jc,
jsLaserIndex const  laserIndex,
jsOldCalibrationValue  oldCalibrations[],
UINT32  nCalibrations 
)

Reads the specified number of old position calibrations for the selected laser from the scanner.

See also
jsSendPositionCalibrationN()
jsReadPositionCalibrationN()
Parameters
jcThe connection to the scanner.
laserIndexWhich laser to read the position calibration for.
oldCalibrationsAn array of jsOldCalibrationValue objects to store the old calibrations in.
nCalibrationsThe number of elements in jsOldCalibrationValue.
Returns
The number of calibrations read on success.
0 if there are no old calibrations.
INVALID_PARAMETER if jc or oldCalibrations NULL or if laserIndex is invalid.
SCANNER_FAILURE on all connection failures.

◆ jsReadPositionCalibrationN()

int jsReadPositionCalibrationN ( JCONNECTION const  jc,
jsLaserIndex const  laserIndex,
double *  xOffset,
double *  yOffset,
double *  roll 
)

Reads the current position calibration for the selected laser from the scanner.

See also
jsSendPositionCalibrationN()
jsReadOldPositionCalibrationsN()
Since
Revision 1932
Parameters
jcThe connection to the scanner.
laserIndexWhich laser to read the position calibration for.
xOffsetStores the value of the scanner's x offset.
yOffsetStores the value of the scanner's y offset.
rollStores the value of the scanner's rotation.
Returns
0 on success.
INVALID_PARAMETER if jc, xOffset, yOffset, or roll is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsReadScanWindowN()

int jsReadScanWindowN ( JCONNECTION const  jc,
jsLaserIndex const  laserIndex,
int *  top,
int *  bottom,
int *  left,
int *  right 
)

Reads the current scan window for the selected laser from the scanner.

Since
Revision 2138 / Scanner Build 1800
Parameters
jcThe connection to the scanner.
laserIndexWhich laser to read the position calibration for.
topLocation to store window top in 1/1000 of inch or mm units (based on Units setting in paramters)
bottomLocation to store window bottom in 1/1000 of inch or mm units
leftLocation to store window left in 1/1000 of inch or mm units
rightLocation to store window right in 1/1000 of inch or mm units
Returns
0 on success.
INVALID_PARAMETER if jc, top, bottom, left, or right is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsSendPositionCalibrationN()

int jsSendPositionCalibrationN ( JCONNECTION const  jc,
jsLaserIndex const  laserIndex,
double const  xOffset,
double const  yOffset,
double const  roll 
)

Sends a position calibration for the selected laser to the scanner.

See also
jsReadPositionCalibrationN()
jsReadOldPositionCalibrationsN()
Parameters
jcThe connection to the scanner.
laserIndexWhich laser to send the position calibration for.
xOffsetThe new value of the scanner's x offset.
yOffsetThe new value of the scanner's y offset.
rollThe new value of the scanner's rotation.
Returns
0 on success.
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsSetBaseIpChar()

int jsSetBaseIpChar ( UINT32 const  serialNumber,
char const *const  baseIpAddress,
char const *const  netmask 
)

Sets a scanner's base IP address.

The IP address will be determined by adding the scanner's Cable ID to the base IP address.

Parameters
serialNumberThe serial number of the scanner whose IP address you want to set.
baseIpAddressThe base IP address the scanner will use to determine its final IP address.
netmaskThe IP netmask the scanner will use.
Returns
0 on success.
INVALID_PARAMETER if baseIpAddress or netmask is NULL or invalid.
-1 on all other failures.

◆ jsSetBaseIpInt()

int jsSetBaseIpInt ( UINT32 const  serialNumber,
UINT32 const  baseIpAddress,
UINT32 const  netmask 
)

Sets a scanner's base IP address.

The IP address will be determined by adding the scanner's Cable ID to the base IP address.

Parameters
serialNumberThe serial number of the scanner whose IP address you want to set.
baseIpAddressMust be in network byte order. An integer representing the base IP address the scanner will use to determine its final IP address.
netmaskMust be in network byte order. An integer representing the IP netmask the scanner will use.
Returns
0 on success.
-1 on all failures.

◆ jsSetCableId()

int jsSetCableId ( UINT32 const  serialNumber,
UINT32 const  cableId 
)

Overrides the cable ID physically wired into a scanner.

The new cable ID is persistent. If the scanner is rebooted, it will ignore the physically wired in cable ID. If the scanner is set to use Base+IP addressing, the scanner's IP address will change according to the new IP address.

See also
jsClearCableId()
Parameters
serialNumberThe serial number of the scanner to change.
cableIdThe cable ID you wish the scanner to have.
Returns
0 on success.
INVALID_PARAMETER if cableId is over 31.
-1 on all other failures.

◆ jsSetStaticIpChar()

int jsSetStaticIpChar ( UINT32 const  serialNumber,
char const *const  staticIpAddress,
char const *const  netmask 
)

Sets a scanner's static IP address.

The IP address will be static; it will not depend on the Cable ID of the scanner. If the scanner is moved to a different location with a different Cable ID, it will have the same IP address.

Parameters
serialNumberThe serial number of the scanner whose IP address you want to set.
staticIpAddressThe IP address the scanner will use.
netmaskThe IP netmask the scanner will use.
Returns
0 on success.
INVALID_PARAMETER if baseIpAddress or netmask is NULL or invalid.
-1 on all other failures.

◆ jsSetStaticIpInt()

int jsSetStaticIpInt ( UINT32 const  serialNumber,
UINT32 const  staticIpAddress,
UINT32 const  netmask 
)

Sets a scanner's static IP address.

The IP address will be static; it will not depend on the Cable ID of the scanner. If the scanner is moved to a different location with a different Cable ID, it will have the same IP address.

Parameters
serialNumberThe serial number of the scanner whose IP address you want to set.
staticIpAddressMust be in network byte order. An integer representing the IP address the scanner will use.
netmaskMust be in network byte order. An integer representing the IP netmask the scanner will use.
Returns
0 on success.
-1 on all failures.