JCam DLL API Reference
jcam_dll.h File Reference

Data structures used for communicating with the JS20/JS25 scanheads. More...

#include <stddef.h>
#include <atlsafe.h>
#include <windef.h>

Go to the source code of this file.

Classes

struct  tagProfileDataPoint
 Represents a coordinate and its associated pixel brightness. More...
 
struct  tagScanDataPoint
 Represents a subpixel point from a scanner and its brightness. More...
 
struct  tagProfile
 Profile data from the scanner. More...
 
struct  tagImage
 Image data from the scanner. More...
 
struct  tagScan
 Scan data from the scanner. More...
 
struct  tagResponsePacket
 Responses from scanners on the network. More...
 
struct  tagOldCalibrationValue
 Old position calibration parameters sent to the scanner. More...
 

Typedefs

typedef signed char INT8
 Signed 8 bit integer. More...
 
typedef signed short INT16
 Signed 16 bit integer. More...
 
typedef signed int INT32
 Signed 32 bit integer. More...
 
typedef unsigned char UINT8
 Unsigned 8 bit integer. More...
 
typedef unsigned short UINT16
 Unsigned 16 bit integer. More...
 
typedef unsigned int UINT32
 Unsigned 32 bit integer. More...
 
typedef enum jsLaserIndexTag jsLaserIndex
 A type for specifying which laser to use. More...
 
typedef void * JCONNECTION
 An opaque handle for connections to scanners. More...
 
typedef struct tagProfileDataPoint ProfileDataPoint
 Represents a coordinate and its associated pixel brightness. More...
 
typedef struct tagScanDataPoint ScanDataPoint
 Represents a subpixel point from a scanner and its brightness. More...
 
typedef struct tagProfile jsProfile
 Profile data from the scanner. More...
 
typedef struct tagImage jsImage
 Image data from the scanner. More...
 
typedef struct tagScan jsScan
 Scan data from the scanner. More...
 
typedef struct tagResponsePacket jsResponsePacket
 Responses from scanners on the network. More...
 
typedef struct tagOldCalibrationValue jsOldCalibrationValue
 Old position calibration parameters sent to the scanner. More...
 

Enumerations

enum  jsConstants {
  OPERATION_FAILURE = 21,
  SCANNER_FAILURE = -1,
  INVALID_PARAMETER = -2,
  PROFILE_UNAVAILABLE = -3,
  SOCKET_TIMEOUT = -4,
  SYNC_MODE_OVERRUN = 0x00000001,
  MAX_HORIZONTAL = 324,
  MAX_VERTICAL = 243,
  IPS_STATIC = 0,
  IPS_BY_ID = 1,
  IPS_BY_DHCP = 2,
  STATUS_NORMAL = 0,
  STATUS_ACTIVE = 1,
  OPTIONS_SIZE = 512,
  DATE_LENGTH = 32
}
 Constants that avoid the traditional problems of #define constants. More...
 
enum  jsLaserIndexTag {
  LASER0 = 0,
  LASER1 = 1,
  LASER2 = 2,
  LASER3 = 3,
  LASER4 = 4
}
 A type for specifying which laser to use. More...
 

Functions

int jsGetJcamDllMajorVersionNumber ()
 Returns the major revision number of the DLL. More...
 
int jsGetJcamDllMinorVersionNumber ()
 Returns the minor revision number of the DLL. More...
 
JCONNECTION jsOpenConnection (char const *const host)
 Opens a connection to the specified host. More...
 
JCONNECTION jsOpenConnectionInt (int const host)
 Opens a connection to the specified host. More...
 
JCONNECTION jsOpenConnectionBase (char const *const host, UINT32 const cableID)
 Opens a connection to the specified scanner using Base IP + Cable ID addressing. More...
 
int jsCloseConnection (JCONNECTION const jc)
 Closes a JCONNECTION. More...
 
int jsSendProfileRequestN (JCONNECTION const jc, jsLaserIndex const laserIndex)
 Sends a request for a profile from the specified laser. More...
 
int jsReadProfileN (JCONNECTION const jc, jsProfile *const profile)
 Reads a profile from the connection. More...
 
int jsGetProfileN (JCONNECTION const jc, jsLaserIndex const laserIndex, jsProfile *const profile)
 Requests and reads a profile from the specified laser. More...
 
int jsGetProfileFromAllLasers (JCONNECTION const jc, jsProfile *const profiles, size_t const cProfiles)
 Requests and reads a profile from each laser the scanner has. More...
 
int jsGetImage (JCONNECTION const jc, jsImage *const image)
 Requests and reads an image. More...
 
int jsGetImageN (JCONNECTION const jc, jsLaserIndex const laserIndex, jsImage *const image)
 Requests and reads an image with the specified laser on. More...
 
int jsGetScan (JCONNECTION const jc, jsScan *const scan)
 Requests and reads a scan. More...
 
int jsGetScanN (JCONNECTION const jc, jsLaserIndex const laserIndex, jsScan *const scan)
 Requests and reads a scan with the specified laser on. More...
 
int jsGetImageScan (JCONNECTION const jc, jsImage *const image, jsScan *const scan)
 Requests and reads an image and scan. More...
 
int jsGetImageScanN (JCONNECTION const jc, jsLaserIndex const laserIndex, jsImage *const image, jsScan *const scan)
 Requests and reads an image and scan with the specified laser on. More...
 
int jsGetDiagnosticScan (JCONNECTION const jc, int const cameraExposure, int const laserExposure, const jsLaserIndex laserIndex, jsScan *const scan)
 Requests and reads a scan with the specified laser and camera timings. This function requires firmware revision 13817 and higher. More...
 
int jsGetDiagnosticImageScan (JCONNECTION const jc, int const cameraExposure, int const laserExposure, const jsLaserIndex laserIndex, jsImage *const image, jsScan *const scan)
 Requests and reads an image and scan with the specified laser and camera timings. This function requires firmware revision 13817 and higher. More...
 
int jsEnterPulseSyncMode (JCONNECTION const jc)
 Causes the scanner to enter Start Scan Triggered Synchronized Scanning Mode. More...
 
int jsEnterEncoderSyncMode (JCONNECTION const jc)
 Causes the scanner to enter Encoder Synchronized Scanning Mode. More...
 
int jsEnterTimeSyncMode (JCONNECTION const jc)
 Causes the scanner to enter Time Synchronized Scanning Mode. More...
 
int jsStartPulseMaster (JCONNECTION const jc, int pulseInterval, int pulseCount)
 Causes the scanner to output a pulse train on the Start Scan I/O. The period and number of pulses are configurable. More...
 
int jsStopPulses (JCONNECTION const jc)
 Causes the scanner to stop generating a pulse train on the Start Scan I/O. More...
 
int jsSetAlternatingExposure (JCONNECTION const jc, bool const enable, int const exposure1, int const exposure2)
 Set the alternating exposure parameters. Only works in sync mode. Settings are lost when exiting sync mode and must be resent after re-entering syncmode. More...
 
int jsHaltSyncMode (JCONNECTION const jc)
 Causes the scanner to halt Time or Encoder Synchronized Scanning Mode. More...
 
int jsExitSyncMode (JCONNECTION const jc)
 Causes the scanner to exit Time or Encoder Synchronized Scanning Mode. More...
 
int jsSendMultipleProfileRequest (JCONNECTION const jc, UINT32 const nProfiles)
 Sends a request for up to nProfiles profiles to the scanner while in Synchronized Scanning Mode. More...
 
int jsReadMultipleProfiles (JCONNECTION const jc, jsProfile *const profiles, UINT32 nProfiles)
 Reads up to nProfiles profiles from jc after a jsSendMultipleProfileRequest() call in Synchronized Scanning Mode. More...
 
int jsReadMultipleProfilesTimeout (JCONNECTION const jc, jsProfile *const profiles, UINT32 cProfiles, long timeoutMilliseconds)
 Requests and reads up to n profiles from the scanner while in either Synchronized Scanning Mode. More...
 
int jsGetMultipleProfiles (JCONNECTION const jc, jsProfile *const profiles, UINT32 const cProfiles)
 Requests and reads up to n profiles from the scanner while in either Synchronized Scanning Mode. More...
 
int jsSendProfileRequest (JCONNECTION const jc)
 Sends a request for a profile. More...
 
int jsReadProfile (JCONNECTION const jc, jsProfile *const profile)
 Reads a profile from the connection. More...
 
int jsGetProfile (JCONNECTION const jc, jsProfile *const profile)
 Requests and reads a profile from the default laser. More...
 
size_t jsGetNumberOfOutstandingRequests (JCONNECTION const jc)
 Returns the number of unread requests from either jsSendProfileRequestN() or jsSendMultipleProfileRequest(). More...
 
int jsCleanUpOutstandingRequests (JCONNECTION const jc)
 Reads and discards all the profiles in the TCP/IP stack generated by jsSendProfileRequestN() or jsSendMultipleProfileRequest(). More...
 
int jsSetEncoderValue (JCONNECTION const jc, UINT16 newEncoderValue)
 Sets the scanner's internal encoder value. More...
 
int jsSetEncoderValue32 (JCONNECTION const jc, UINT32 newEncoderValue)
 Sets the scanner's internal encoder value. More...
 
int jsBeginSendParameterFileToScanner (JCONNECTION const jc, char const *const filename)
 Starts sending a parameter file to the scanhead. Must be followed with a called to jsEndSendParameterFileToScanner(). More...
 
int jsEndSendParametersToScanner (JCONNECTION const jc)
 Completes the sending of parameters. Should always and only be called after a call to jsBeginSendParameterFileToScanner() or jsBeginSendParametersToScanner(). More...
 
int jsSendParameterFileToScanner (JCONNECTION const jc, char const *const filename)
 Sends a parameter file to the scanhead. More...
 
int jsSendParametersToScanner (JCONNECTION const jc, char const *const parameters)
 Sends parameters to the scanhead. More...
 
int jsBeginSendParametersToScanner (JCONNECTION const jc, char const *const parameters)
 Starts sending a parameter string to the scanhead. Must be followed with a called to jsEndSendParametersToScanner(). More...
 
int jsGetParameterFileFromScanner (JCONNECTION const jc, char const *const filename)
 Reads the current parameter file from the scanhead and writes them to the specified file. May not be called while the scanner is in Synchronized Scanning Mode.
More...
 
size_t jsGetNumberOfErrorMessages (JCONNECTION const jc)
 Returns the number of error messages after a jsSendParameterFileToScanner() call returned OPERATION_FAILURE. More...
 
char const *const jsGetErrorMessage (JCONNECTION const jc, size_t i)
 Returns the specified error message. More...
 
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 jsGetScannerStatusFromScanner (JCONNECTION const jc)
 Reads status from the scanner into a data structure inside the opaque JCONNECTION. More...
 
int jsGetScannerStatusValue (JCONNECTION const jc, size_t i, int *value)
 Gets the specified status value from the data structure inside the JCONNECTION. More...
 
int jsGetStatusDescriptionFromScanner (JCONNECTION const jc, UINT32 i, char *const description, UINT32 description_length)
 Reads a descriptive text string from the scanner for the particular status index. More...
 
int jsGetImagePixel (jsImage const *const image, size_t const x, size_t const y)
 Returns a pixel value from an image. More...
 
int jsFindAllScanners (jsResponsePacket responses[], const size_t nResponses)
 Attempts to discover all scanners on the network. More...
 
int jsFindScannerByCableId (int const cableId, jsResponsePacket responses[], const size_t nResponses)
 Attempts to discover the scanner(s) on the network with the specified Cable ID. More...
 
int jsFindScannerBySerialNumber (int const serialNumber, jsResponsePacket responses[], const size_t nResponses)
 Attempts to discover the scanner on the network with the specified serial number. 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...
 
int jsIsInSyncMode (JCONNECTION const jc)
 Returns if a scanner is in Synchronized Mode. More...
 
BOOL jsInitialize ()
 Initializes TCP/IP communications. More...
 
void jsCleanup ()
 Gracefully ends TCP/IP communications. More...
 

Detailed Description

Data structures used for communicating with the JS20/JS25 scanheads.

Typedef Documentation

◆ INT16

typedef signed short INT16

Signed 16 bit integer.

◆ INT32

typedef signed int INT32

Signed 32 bit integer.

◆ INT8

typedef signed char INT8

Signed 8 bit integer.

◆ JCONNECTION

typedef void* JCONNECTION

An opaque handle for connections to scanners.

JCONNECTION's are full-duplex request/reply connections. Functions have been provided that handle all the request/reply semantics.

◆ jsImage

typedef struct tagImage jsImage

Image data from the scanner.

◆ jsLaserIndex

A type for specifying which laser to use.

If an invalid laser is specified, the connection will be closed.

◆ jsOldCalibrationValue

Old position calibration parameters sent to the scanner.

◆ jsProfile

typedef struct tagProfile jsProfile

Profile data from the scanner.

◆ jsResponsePacket

Responses from scanners on the network.

◆ jsScan

typedef struct tagScan jsScan

Scan data from the scanner.

◆ ProfileDataPoint

Represents a coordinate and its associated pixel brightness.

◆ ScanDataPoint

Represents a subpixel point from a scanner and its brightness.

◆ UINT16

typedef unsigned short UINT16

Unsigned 16 bit integer.

◆ UINT32

typedef unsigned int UINT32

Unsigned 32 bit integer.

◆ UINT8

typedef unsigned char UINT8

Unsigned 8 bit integer.

Enumeration Type Documentation

◆ jsConstants

Constants that avoid the traditional problems of #define constants.

Enumerator
OPERATION_FAILURE 

An operation was unable to complete.

SCANNER_FAILURE 

The connection to the scanner is invalid.

INVALID_PARAMETER 

A parameter to a function was NULL or out of range.

PROFILE_UNAVAILABLE 

A scanner in Synchronized Scanning Mode has no available profiles.

SOCKET_TIMEOUT 

A connection to a scanner timed out.

SYNC_MODE_OVERRUN 

If this bit is set in a jsProfile's flags field, then Synchronized Scanning Mode is running the scanner too fast.

MAX_HORIZONTAL 

CCD sensor dimensions.

MAX_VERTICAL 

CCD sensor dimensions.

IPS_STATIC 

Static IP Address for a scanner.

IPS_BY_ID 

IP Address is determined by the cable ID.

IPS_BY_DHCP 

IP Address is assigned with DHCP.

STATUS_NORMAL 

The scanner is fine.

STATUS_ACTIVE 

The scanner is scanning.

OPTIONS_SIZE 

The number of bytes in a jsResponsePacket's options field.

DATE_LENGTH 

The maximum length of the date field in a jsOldCalibrationValue.

◆ jsLaserIndexTag

A type for specifying which laser to use.

If an invalid laser is specified, the connection will be closed.

Enumerator
LASER0 

Furthest from the camera.

LASER1 

Closer to the camera than LASER0.

LASER2 

Closer to the camera than LASER1.

LASER3 

Closer to the camera than LASER2.

LASER4 

Closer to the camera than LASER3.