JCam DLL API Reference
Encoder/Time Synchronized Scanning

Functions

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 jsIsInSyncMode (JCONNECTION const jc)
 Returns if a scanner is in Synchronized Mode. More...
 

Detailed Description

During Synchronized Scanning Mode, the scanner will automatically scan at specific intervals. The interval is set in the scanner parameters, and is based on either the encoder or time.

  1. The scanner powers up into Non-Synchronized Scanning Mode.

  2. Enter Synchronized Scanning Mode by calling one of these functions:

  3. In Synchronized Scanning Mode, retrieve profiles from the scanner by calling any of these functions:

  4. Leave Synchronized Scanning Mode by:

If you call a non-synchronized function during Synchronized Scanning Mode, the scanner will discard any remaining profiles, leave Synchronized Scanning Mode, and close the connection.

jsGetProfile() is the only function that can be called in both Non-Synchronized and Synchronized Scanning Mode.

Function Documentation

◆ jsCleanUpOutstandingRequests()

int jsCleanUpOutstandingRequests ( JCONNECTION const  jc)

Reads and discards all the profiles in the TCP/IP stack generated by jsSendProfileRequestN() or jsSendMultipleProfileRequest().

Reads any outstanding responses to jsSendProfileRequestN() or jsSendMultipleProfileRequest() calls.

See also
jsGetNumberOfOutstandingRequests()
jsSendProfileRequestN()
jsReadProfileN()
jsSendMultipleProfileRequest()
jsReadMultipleProfiles()
Parameters
jcThe connection to discard unread profiles from.
Returns
0 on success.
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsEnterEncoderSyncMode()

int jsEnterEncoderSyncMode ( JCONNECTION const  jc)

Causes the scanner to enter Encoder Synchronized Scanning Mode.

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

See also
jsExitSyncMode()
Parameters
jcThe connection to the scanner.
Returns
0 on success.
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsEnterPulseSyncMode()

int jsEnterPulseSyncMode ( JCONNECTION const  jc)

Causes the scanner to enter Start Scan Triggered Synchronized Scanning Mode.

While in Pulse Triggered Synchronized Scanning Mode, the scanners will trigger on the appropriate edge of the Start Scan signal, depending on the presence of StartScanTriggerOnHigh.

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

See also
jsExitSyncMode()
jsStartPulseMaster()
jsStopPulses()
Parameters
jcThe connection to the scanner.
Returns
0 on success.
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsEnterTimeSyncMode()

int jsEnterTimeSyncMode ( JCONNECTION const  jc)

Causes the scanner to enter Time Synchronized Scanning Mode.

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

See also
jsExitSyncMode()
Parameters
jcThe connection to the scanner.
Returns
0 on success.
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsExitSyncMode()

int jsExitSyncMode ( JCONNECTION const  jc)

Causes the scanner to exit Time or Encoder Synchronized Scanning Mode.

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

Any profiles queued in the scanner will be lost. This functionalso calls jsCleanUpOutstandingRequests() in order to fully reset scanning.

See also
jsEnterEncoderSyncMode()
jsEnterTimeSyncMode()
jsHaltSyncMode()
jsGetNumberOfOutstandingRequests()
jsCleanUpOutstandingRequests()
Parameters
jcThe connection to the scanner.
Returns
0 on success.
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsGetMultipleProfiles()

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.

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

If the parameters attempt to run the scanner faster than it can physically scan, then bit 0 in the flags field of the jsProfile's will be set.

Parameters
jcThe connection to the scanner.
profilesPointer to an array of jsProfile's.
cProfilesThe number of jsProfile's that profiles points to. Also how many profiles are requested from the scanner.
Returns
The number of valid profiles on success.
0 if no profiles are available.
SCANNER_FAILURE on all connection failures.
INVALID_PARAMETER if jc or profiles is NULL.
SOCKET_TIMEOUT if the read took longer than 5 seconds.

◆ jsGetNumberOfOutstandingRequests()

size_t jsGetNumberOfOutstandingRequests ( JCONNECTION const  jc)

Returns the number of unread requests from either jsSendProfileRequestN() or jsSendMultipleProfileRequest().

Returns the number of unread requests generated by either jsSendProfileRequestN() or jsSendMultipleProfileRequest(). This function does not differentiate between requests generated by jsSendProfileRequestN() or jsSendMultipleProfileRequest().

The number of profiles generated by jsSendMultipleProfileRequest() may be higher than the number of outstanding requests since more than one profile could be returned by one request.

Any further calls to jsReadProfileN() or jsReadMultipleProfiles() will block unless a new call to jsSendProfileRequestN() or jsSendMultipleProfileRequest() is made.

See also
jsCleanUpOutstandingRequests()
jsSendProfileRequestN()
jsReadProfileN()
jsSendMultipleProfileRequest()
jsReadMultipleProfiles()
Parameters
jcThe connection to ask how many unread responses there are.
Returns
The number of unread responses from either jsSendProfileRequestN() or jsSendMultipleProfileRequest().

◆ jsGetProfile()

int jsGetProfile ( JCONNECTION const  jc,
jsProfile *const  profile 
)

Requests and reads a profile from the default laser.

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

Parameters
jcThe connection to read a profile from.
profileWhere the profile is stored.
Returns
0 on success.
INVALID_PARAMETER if jc or profile is NULL.
SCANNER_FAILURE on all connection failures.
PROFILE_UNAVAILABLE if the scanner is in Synchronized Scanning Mode and there is no profile available.
SOCKET_TIMEOUT if the read took longer than 5 seconds.

◆ jsHaltSyncMode()

int jsHaltSyncMode ( JCONNECTION const  jc)

Causes the scanner to halt Time or Encoder Synchronized Scanning Mode.

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

Any scans queued up in the scanner can still be read using jsGetProfile(). The scanner is still in Synchronized Scanning Mode after calling this function. A call to jsExitSyncMode() must follow in order to exit Synchronized Scanning Mode.

See also
jsExitSyncMode()
jsEnterEncoderSyncMode()
jsEnterTimeSyncMode()
Parameters
jcThe connection to the scanner.
Returns
0 on success.
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsIsInSyncMode()

int jsIsInSyncMode ( JCONNECTION const  jc)

Returns if a scanner is in Synchronized Mode.

Parameters
jcThe connection to the scanner.
Returns
1 if scanner is in Synchronized Mode.
0 if scanner is not in Synchronized Mode.
INVALID_PARAMETER if jc is NULL.

◆ jsReadMultipleProfiles()

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.

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

nProfiles must be equal to the number of profiles requested in the corresponding call to jsSendMultipleProfileRequest(), and profiles must point to an array of nProfiles jsProfile structs.

If the parameters attempt to run the scanner faster than it can physically scan, then bit 0 in the flags field of the jsProfile's will be set.

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

See also
jsSendMultipleProfileRequest()
jsGetNumberOfOutstandingRequests()
jsCleanUpOutstandingRequests()
Parameters
jcThe connection to the scanner.
profilesPointer to an array of jsProfile's.
nProfilesThe number of jsProfile's that profiles points to.
Returns
The number of valid profiles on success.
0 if no profiles are available.
SCANNER_FAILURE on all connection failures.
INVALID_PARAMETER if jc or profiles is NULL.
SOCKET_TIMEOUT if the read took longer than 5 seconds.

◆ jsReadMultipleProfilesTimeout()

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.

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

If the parameters attempt to run the scanner faster than it can physically scan, then bit 0 in the flags field of the jsProfile's will be set.

Parameters
jcThe connection to the scanner.
profilesPointer to an array of jsProfile's.
cProfilesThe number of jsProfile's that profiles points to. Also how many profiles are requested from the scanner.
timeoutMillisecondsThe maximum number of milliseconds that a read is allowed to take.
Returns
The number of valid profiles on success.
0 if no profiles are available.
SCANNER_FAILURE on all connection failures.
INVALID_PARAMETER if jc or profiles is NULL.
SOCKET_TIMEOUT if the read took longer than the specified timeout period.

◆ jsReadProfile()

int jsReadProfile ( JCONNECTION const  jc,
jsProfile *const  profile 
)

Reads a profile from the connection.

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

A call to jsSendProfileRequest() 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
jcThe connection to read the profile from.
profileWhere the profile is stored.
Returns
0 or #PROFILE_UNAVAILBLE on success.
#PROFILE_UNAVAILBLE if in sync mode and the profile queue is empty
INVALID_PARAMETER if jc or profile is NULL.
SCANNER_FAILURE on all connection failures.
SOCKET_TIMEOUT if the read took longer than 5 seconds.

◆ jsSendMultipleProfileRequest()

int jsSendMultipleProfileRequest ( JCONNECTION const  jc,
UINT32 const  nProfiles 
)

Sends a request for up to nProfiles profiles to the scanner while in Synchronized Scanning Mode.

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

No profiles are read from the connection during this call. In order to read the profiles, a call to jsReadMultipleProfiles() must follow.

If the parameters attempt to run the scanner faster than it can physically scan, then bit 0 in the flags field of the jsProfile will be set.

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

See also
jsReadMultipleProfiles()
jsGetNumberOfOutstandingRequests()
jsCleanUpOutstandingRequests()
Parameters
jcThe connection to the scanner.
nProfilesThe number of profiles to request from the scanner.
Returns
0 on success.
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsSendProfileRequest()

int jsSendProfileRequest ( JCONNECTION const  jc)

Sends a request for a profile.

May be called while the scanner is or is not 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
jcThe connection to send the request to.
See also
jsReadProfileN()
jsGetNumberOfOutstandingRequests()
jsCleanUpOutstandingRequests()
Returns
0 on success.
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsSetAlternatingExposure()

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.

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

Parameters
jcThe connection to the scanner.
enableIf true enable the alternating exposure mode, if false return to normal exposure mode.
exposure1One of the two exposure times, must be between 10 and 650000.
exposure2One of the two exposure times, must be between 10 and 650000
Returns
0 on success.
INVALID_PARAMETER if jc is NULL, or other parameters are out of range.
SCANNER_FAILURE on all connection failures.

◆ jsSetEncoderValue()

int jsSetEncoderValue ( JCONNECTION const  jc,
UINT16  newEncoderValue 
)

Sets the scanner's internal encoder value.

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

Parameters
jcThe connection to the scanner.
newEncoderValueThe new encoder value for the scanner.
Returns
0 on success.
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsSetEncoderValue32()

int jsSetEncoderValue32 ( JCONNECTION const  jc,
UINT32  newEncoderValue 
)

Sets the scanner's internal encoder value.

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

Parameters
jcThe connection to the scanner.
newEncoderValueThe new encoder value for the scanner.
Returns
0 on success.
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE on all connection failures.

◆ jsStartPulseMaster()

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.

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

See also
jsStopPulses()
Parameters
jcThe connection to the scanner.
pulseIntervalThe period in microseconds of the pulse train. Between 1,000 and 5,000,000.
pulseCountThe number of pulses to send before stopping. If zero pulses will be continuously sent. Max value is 511.
Returns
0 on success.
INVALID_PARAMETER if jc is NULL, or other parameters are out of range.
SCANNER_FAILURE on all connection failures.

◆ jsStopPulses()

int jsStopPulses ( JCONNECTION const  jc)

Causes the scanner to stop generating a pulse train on the Start Scan I/O.

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

See also
jsStartPulseMaster()
Parameters
jcThe connection to the scanner.
Returns
0 on success.
INVALID_PARAMETER if jc is NULL.
SCANNER_FAILURE on all connection failures.