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... | |
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.
The scanner powers up into Non-Synchronized Scanning Mode.
Enter Synchronized Scanning Mode by calling one of these functions:
In Synchronized Scanning Mode, retrieve profiles from the scanner by calling any of these functions:
Leave Synchronized Scanning Mode by:
Call jsEnterEncoderSyncMode()
or jsEnterTimeSyncMode()
to discard any remaining profiles and restart Synchronized Scanning Mode.
Call jsExitSyncMode()
to discard any remaining profiles and go to Non-Synchronized Scanning Mode.
jsHaltSyncMode()
, then retrieve any remaining profiles. Call jsExitSyncMode()
to return to Non-Synchronized Scanning Mode, or jsEnterEncoderSyncMode()
or jsEnterTimeSyncMode()
to restart Synchronized Scanning Mode. 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.
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.
jsGetNumberOfOutstandingRequests()
jsSendProfileRequestN()
jsReadProfileN()
jsSendMultipleProfileRequest()
jsReadMultipleProfiles()
jc | The connection to discard unread profiles from. |
INVALID_PARAMETER
if jc
is NULL
. SCANNER_FAILURE
on all connection failures. 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.
jsExitSyncMode()
jc | The connection to the scanner. |
INVALID_PARAMETER
if jc
is NULL
. SCANNER_FAILURE
on all connection failures. 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.
jc | The connection to the scanner. |
INVALID_PARAMETER
if jc
is NULL
. SCANNER_FAILURE
on all connection failures. 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.
jsExitSyncMode()
jc | The connection to the scanner. |
INVALID_PARAMETER
if jc
is NULL
. SCANNER_FAILURE
on all connection failures. 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.
jsEnterEncoderSyncMode()
jsEnterTimeSyncMode()
jsHaltSyncMode()
jsGetNumberOfOutstandingRequests()
jsCleanUpOutstandingRequests()
jc | The connection to the scanner. |
INVALID_PARAMETER
if jc
is NULL
. SCANNER_FAILURE
on all connection failures. 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.
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. |
SCANNER_FAILURE
on all connection failures. INVALID_PARAMETER
if jc
or profiles
is NULL
. SOCKET_TIMEOUT
if the read took longer than 5 seconds. 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.
jsCleanUpOutstandingRequests()
jsSendProfileRequestN()
jsReadProfileN()
jsSendMultipleProfileRequest()
jsReadMultipleProfiles()
jc | The connection to ask how many unread responses there are. |
jsSendProfileRequestN()
or jsSendMultipleProfileRequest()
. 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.
jc | The connection to read a profile from. |
profile | Where the profile is stored. |
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. 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.
jc | The connection to the scanner. |
INVALID_PARAMETER
if jc
is NULL
. SCANNER_FAILURE
on all connection failures. int jsIsInSyncMode | ( | JCONNECTION const | jc | ) |
Returns if a scanner is in Synchronized Mode.
jc | The connection to the scanner. |
INVALID_PARAMETER
if jc
is NULL
. 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.
jsSendMultipleProfileRequest()
jsGetNumberOfOutstandingRequests()
jsCleanUpOutstandingRequests()
jc | The connection to the scanner. |
profiles | Pointer to an array of jsProfile's . |
nProfiles | The number of jsProfile's that profiles points to. |
SCANNER_FAILURE
on all connection failures. INVALID_PARAMETER
if jc
or profiles
is NULL
. SOCKET_TIMEOUT
if the read took longer than 5 seconds. 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.
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. |
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. 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.
jc | The connection to read the profile from. |
profile | Where the profile is stored. |
#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. 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.
jc | The connection to the scanner. |
nProfiles | The number of profiles to request from the scanner. |
INVALID_PARAMETER
if jc
is NULL
. SCANNER_FAILURE
on all connection failures. 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.
jc | The connection to send the request to. |
INVALID_PARAMETER
if jc
is NULL
. SCANNER_FAILURE
on all connection failures. 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.
jc | The connection to the scanner. |
enable | If true enable the alternating exposure mode, if false return to normal exposure mode. |
exposure1 | One of the two exposure times, must be between 10 and 650000. |
exposure2 | One of the two exposure times, must be between 10 and 650000 |
INVALID_PARAMETER
if jc
is NULL
, or other parameters are out of range. SCANNER_FAILURE
on all connection failures. 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.
jc | The connection to the scanner. |
newEncoderValue | The new encoder value for the scanner. |
INVALID_PARAMETER
if jc
is NULL
. SCANNER_FAILURE
on all connection failures. 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.
jc | The connection to the scanner. |
newEncoderValue | The new encoder value for the scanner. |
INVALID_PARAMETER
if jc
is NULL
. SCANNER_FAILURE
on all connection failures. 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.
jsStopPulses()
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. |
INVALID_PARAMETER
if jc
is NULL
, or other parameters are out of range. SCANNER_FAILURE
on all connection failures. 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.
jsStartPulseMaster()
jc | The connection to the scanner. |
INVALID_PARAMETER
if jc
is NULL
. SCANNER_FAILURE
on all connection failures.