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

Encoder/Time Synchronized Scanning

Functions

JCAM_DLL_API int STDCALL jsEnterStartScanTriggeredMode (JCONNECTION const jc)
 Causes the scanner to enter Start Scan Triggered Synchronized Scanning Mode.
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 jsStartPulseMaster (JCONNECTION const jc, int pulseInterval, int pulseCount)
 Causes the scanner to ouput a pulse train on the Start Scan I/O. The period and number of pulses are configurable.
JCAM_DLL_API int STDCALL jsStopPulses (JCONNECTION const jc)
 Causes the scanner to stop generating a pulse train on the Start Scan I/O.
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 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.
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.
JCAM_DLL_API int STDCALL jsSetEncoderValue32 (JCONNECTION const jc, UINT32 newEncoderValue)
 Sets the scanner's internal encoder value.

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

JCAM_DLL_API int STDCALL jsEnterStartScanTriggeredMode ( JCONNECTION const   jc  ) 

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

While in Start Scan 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()
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 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.

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 jsStartPulseMaster ( JCONNECTION const   jc,
int  pulseInterval,
int  pulseCount 
)

Causes the scanner to ouput 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:
jc The connection to the scanner.
pulseInterval The period in microseconds of the pulse train. Between 1,000 and 5,000,000.
pulseCount The 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.
JCAM_DLL_API int STDCALL 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:
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.
SOCKET_TIMEOUT if the read took longer than 5 seconds.
JCAM_DLL_API int STDCALL 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:
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.
timeoutMilliseconds The 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.
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.
SOCKET_TIMEOUT if the read took longer than 5 seconds.
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.
SOCKET_TIMEOUT if the read took longer than 5 seconds.
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.
JCAM_DLL_API int STDCALL 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:
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.