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

Encoder/Time Synchronized Scanning


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.


Functions

JCAM_DLL_API int STDCALL jsEnterEncoderSyncMode (JCONNECTION const jc)
 Causes the scanner to enter Encoder Synchronized Scanning Mode.
JCAM_DLL_API int STDCALL jsEnterTimeSyncMode (JCONNECTION const jc)
 Causes the scanner to enter Time Synchronized Scanning Mode.
JCAM_DLL_API int STDCALL jsHaltSyncMode (JCONNECTION const jc)
 Causes the scanner to halt Time or Encoder Synchronized Scanning Mode.
JCAM_DLL_API int STDCALL jsExitSyncMode (JCONNECTION const jc)
 Causes the scanner to exit Time or Encoder Synchronized Scanning Mode.
JCAM_DLL_API int STDCALL jsSendMultipleProfileRequest (JCONNECTION const jc, UINT32 const nProfiles)
 Sends a request for up to nProfiles profiles to the scanner while in Synchronized Scanning Mode.
JCAM_DLL_API int STDCALL jsReadMultipleProfiles (JCONNECTION const jc, jsProfile *const profiles, UINT32 nProfiles)
 Reads up to nProfiles profiles from jc after a jsSendMultipleProfileRequest() call in Synchronized Scanning Mode.
JCAM_DLL_API int STDCALL 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.
JCAM_DLL_API int STDCALL jsGetProfile (JCONNECTION const jc, jsProfile *const profile)
 Requests and reads a profile from the default laser.
JCAM_DLL_API size_t STDCALL jsGetNumberOfOutstandingRequests (JCONNECTION const jc)
 Returns the number of unread requests from either jsSendProfileRequestN() or jsSendMultipleProfileRequest().
JCAM_DLL_API int STDCALL jsCleanUpOutstandingRequests (JCONNECTION const jc)
 Reads and discards all the profiles in the TCP/IP stack generated by jsSendProfileRequestN() or jsSendMultipleProfileRequest().
JCAM_DLL_API int STDCALL jsSetEncoderValue (JCONNECTION const jc, UINT16 newEncoderValue)
 Sets the scanner's internal encoder value.

Function Documentation

JCAM_DLL_API int STDCALL 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:
jc The connection to the scanner.
Returns:
0 on success.

INVALID_PARAMETER if jc is NULL.

SCANNER_FAILURE on all connection failures.

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

Parameters:
jc The connection to the scanner.
Returns:
0 on success.

INVALID_PARAMETER if jc is NULL.

SCANNER_FAILURE on all connection failures.

JCAM_DLL_API int STDCALL 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:
jc The connection to the scanner.
Returns:
0 on success.

INVALID_PARAMETER if jc is NULL.

SCANNER_FAILURE on all connection failures.

JCAM_DLL_API int STDCALL 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:
jc The connection to the scanner.
Returns:
0 on success.

INVALID_PARAMETER if jc is NULL.

SCANNER_FAILURE on all connection failures.

JCAM_DLL_API int STDCALL 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:
jc The connection to the scanner.
nProfiles The number of profiles to request from the scanner.
Returns:
0 on success.

INVALID_PARAMETER if jc is NULL.

SCANNER_FAILURE on all connection failures.

JCAM_DLL_API int STDCALL 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:
jc The connection to the scanner.
profiles Pointer to an array of jsProfile's.
nProfiles The 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.

JCAM_DLL_API int STDCALL 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:
jc The connection to the scanner.
profiles Pointer to an array of jsProfile's.
cProfiles The 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.

JCAM_DLL_API int STDCALL 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:
jc The connection to read a 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.

PROFILE_UNAVAILABLE if the scanner is in Synchronized Scanning Mode and there is no profile available.

JCAM_DLL_API size_t STDCALL 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:
jc The connection to ask how many unread responses there are.
Returns:
The number of unread responses from either jsSendProfileRequestN() or jsSendMultipleProfileRequest().

JCAM_DLL_API int STDCALL 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:
jc The connection to discard unread profiles from.
Returns:
0 on success.

INVALID_PARAMETER if jc is NULL.

SCANNER_FAILURE on all connection failures.

JCAM_DLL_API int STDCALL 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:
jc The connection to the scanner.
newEncoderValue The new encoder value for the scanner.
Returns:
0 on success.

INVALID_PARAMETER if jc is NULL.

SCANNER_FAILURE on all connection failures.