JoeScan
  home
our story
news  and events
contact us
    our products
how it works
applications support service

Scanners with Multiple Lasers


Detailed Description

These functions allow you to choose which laser to use. While only the JS20-DL has more than one laser, you can use these functions with any JS20 so long as you specify the valid laser, LASER0.

If you attempt to access an invalid laser, like LASER1 on a single-laser JS20, the connection will close. This is fail-fast behavior. If an empty jsProfile were returned, people would spend all day trying to figure out why the profile had no data. Now, they'll simply spend all day trying to figure out why the connection died.

You may be thinking to yourself, “Why an enum instead of an int?” Good question. The answer is type safety. This way, you can't index an inappropriate laser like -3 — it simply won't compile. You'll have to actively work to index an inappropriate laser instead of having it accidentally happen.

If you still want to use an int, put the enum values into an array like this and pass in the value from the array:

jsLaserIndex laserIndexArray[] = {LASER0, LASER1};
for(int i = 0; i < 2; i++)
  jsGetProfileN(jc, laserIndexArray[i], &profile);


Functions

JCAM_DLL_API int STDCALL jsSendProfileRequestN (JCONNECTION const jc, jsLaserIndex const laserIndex)
 Sends a request for a profile from the specified laser.
JCAM_DLL_API int STDCALL jsReadProfileN (JCONNECTION const jc, jsProfile *const profile)
 Reads a profile from the connection.
JCAM_DLL_API int STDCALL jsGetProfileN (JCONNECTION const jc, jsLaserIndex const laserIndex, jsProfile *const profile)
 Requests and reads a profile from the specified laser.
JCAM_DLL_API int STDCALL jsGetProfileFromAllLasers (JCONNECTION const jc, jsProfile *const profiles, size_t const cProfiles)
 Requests and reads a profile from each laser the scanner has.
JCAM_DLL_API int STDCALL jsGetImageN (JCONNECTION const jc, jsLaserIndex const laserIndex, jsImage *const image)
 Requests and reads an image with the specified laser on.
JCAM_DLL_API int STDCALL jsGetScanN (JCONNECTION const jc, jsLaserIndex const laserIndex, jsScan *const scan)
 Requests and reads a scan with the specified laser on.
JCAM_DLL_API int STDCALL 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.

Function Documentation

JCAM_DLL_API int STDCALL jsSendProfileRequestN ( JCONNECTION const   jc,
jsLaserIndex const  laserIndex 
)

Sends a request for a profile from the specified laser.

May not be called while the scanner is in Synchronized Scanning Mode.

Nothing is read from the connection during this call. Increments the number of outstanding requests for this connection by one.

Parameters:
jc The connection to send the request to.
laserIndex Which laser to use for the scan.
See also:
jsReadProfileN()

jsGetNumberOfOutstandingRequests()

jsCleanUpOutstandingRequests()

Returns:
0 on success.

INVALID_PARAMETER if jc is NULL.

SCANNER_FAILURE on all connection failures.

JCAM_DLL_API int STDCALL jsReadProfileN ( JCONNECTION const   jc,
jsProfile *const   profile 
)

Reads a profile from the connection.

May not be called while the scanner is in Synchronized Scanning Mode.

A call to jsSendProfileRequestN() must have been made to the specified JCONNECTION before this function is called. Otherwise the call will block and eventually time out waiting for a profile that isn't coming.

Decrements the number of outstanding requests for this connection by one.

See also:
jsSendProfileRequestN()

jsGetNumberOfOutstandingRequests()

jsCleanUpOutstandingRequests()

Parameters:
jc The connection to read the profile from.
profile Where the profile is stored.
Returns:
0 on success.

INVALID_PARAMETER if jc or profile is NULL.

SCANNER_FAILURE on all connection failures.

JCAM_DLL_API int STDCALL jsGetProfileN ( JCONNECTION const   jc,
jsLaserIndex const  laserIndex,
jsProfile *const   profile 
)

Requests and reads a profile from the specified laser.

May not be called while the scanner is in Synchronized Scanning Mode.

Parameters:
jc The connection to read a profile from.
laserIndex Which laser to use for the scan.
profile Where the profile is stored.
Returns:
0 on success.

INVALID_PARAMETER if jc or profile is NULL.

SCANNER_FAILURE on all connection failures.

JCAM_DLL_API int STDCALL jsGetProfileFromAllLasers ( JCONNECTION const   jc,
jsProfile *const   profiles,
size_t const   cProfiles 
)

Requests and reads a profile from each laser the scanner has.

May not be called while the scanner is in Synchronized Scanning Mode.

If cProfiles indicates profiles doesn't have enough space, then extra profiles are discarded. Really, profiles should point to an array with enough space for a profile from every laser.

Parameters:
jc The connection to read the profiles from.
profiles Pointer to an array of jsProfile's.
cProfiles The number of jsProfile's that profiles points to.
Returns:
0 on success.

INVALID_PARAMETER if jc or profile is NULL.

SCANNER_FAILURE on all connection failures.

JCAM_DLL_API int STDCALL jsGetImageN ( JCONNECTION const   jc,
jsLaserIndex const  laserIndex,
jsImage *const   image 
)

Requests and reads an image with the specified laser on.

Parameters:
jc The connection to read the image from.
laserIndex Which laser to use for the image.
image Where the image is stored.
Returns:
0 on success.

INVALID_PARAMETER if jc or image is NULL.

SCANNER_FAILURE on all connection failures.

JCAM_DLL_API int STDCALL jsGetScanN ( JCONNECTION const   jc,
jsLaserIndex const  laserIndex,
jsScan *const   scan 
)

Requests and reads a scan with the specified laser on.

Parameters:
jc The connection to read the scan from.
laserIndex Which laser to use for the scan.
scan Where the scan is stored.
Returns:
0 on success.

INVALID_PARAMETER if jc or scan is NULL.

SCANNER_FAILURE on all connection failures.

JCAM_DLL_API int STDCALL 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.

Parameters:
jc The connection to read the image and scan from.
laserIndex Which laser to use for the image and scan.
image Where the image is stored.
scan Where the scan is stored.
Returns:
0 on success.

INVALID_PARAMETER if jc or scan is NULL.

SCANNER_FAILURE on all connection failures.