| heber.x10i: | Types | Modinfo | Source |
This document describes all aspects of the X-line X10i development API. In addition to detailing every available API function this document also discusses subjects which must be taken into account when designing your software (for example ccTalk, speed constraints, security etc). This software user guide is divided into the following chapters:
| TX10iBoard |
| Type TX10iBoard |
| Fields Summary | |
|---|---|
| errors , fittedBoard |
| Methods Summary | |
|---|---|
| BeginPulsedInputCheck | This function begins pulsed input counting on the specified input. |
| CachedReadAndResetSecuritySwitchFlags | This function is a fast version of ReadAndResetSecuritySwitchFlags( ), |
| CheckEEPROM | This function attempts to detect the currently fitted EEPROM. |
| ClearSecuritySwitches | Calling this function will clear the security switch buffer. See the NextSecuritySwitchRead() function for. |
| Close | Close() |
| ConfigureCCTalkPort | This function configures a device on a port (A or B) for ccTalk Mode 1 operation. |
| ConfigureEEPROM | This function allows the user to override automatic EEPROM detection (see CheckEEPROM( )). |
| ConfigurePulsedInputEx | configure reading of input pulses on parallel devices. |
| ConfigureReelsEx | This function must be called if stepper motors are to be controlled by the X-line board. |
| ConfigureRS232Poll | This function configures a device on a port (A or B) for RS232 Polled operation. |
| Create | Create a TX10iBoard object. |
| DecrementPulsedInputCounter | This function decrements the pulsed input counter on the specified input. |
| DeletePolledMessage | This function deletes the first message stored in the buffer. |
| DisableSPI | This function disables the SPI protocol. |
| EmptyPolledBuffer | This function empties the receive buffer for the specified device. |
| EnableSPI | This function initialises the SPI (Serial Peripheral Interface) protocol. |
| Get8051Version | Return the 8051 version as a string. |
| GetBoardSpeed | Return the USB speed the board is connected at. |
| GetClock | This function returns the time, in seconds, as set using SetClock(), plus the number of seconds that have. |
| GetDallasSerialNumber | Return the dallas serial number as a string. |
| GetDllVersion | Return the dll version as a string. |
| GetFittedBoard | This function is ascertains which board is currently fitted. |
| GetInputs | GetInputs:int( button:int, raw:int ) |
| GetLastError | Return the error code for the last function call. |
| GetMultiplexedInputs | Return the multiplexed inputs. |
| GetParallelHopperStatus | *** NOT IMPLEMENTED *** Read the parallel hopper coin release status after a call to ReleaseParallelHopperCoins(). |
| GetParityErrors | This function returns the number of bytes received with a parity error. |
| GetPICSerialNumber | Return the PIC serial number as a string. |
| GetPICVersion | Return the PIC version number as a string. |
| GetProductVersion | Return the product version as a string. |
| GetPulsedInputStatus | This function reports the “jammed” status of a parallel input. |
| GetReelStatus | This function is now obsolete. The Function GetReelStatusEx() (documented in the next section) should be used instead. |
| GetReelStatusEx | his function returns the reel status for all reels. |
| InputMultiplexing | Enable or Disable Multiplexing. |
| NextSecuritySwitchRead | Read security switch state. |
| ReadAndResetSecuritySwitchFlags | This function returns the security switch flags that have opened and closed since the last time the. |
| ReadEEPROM | This function reads a block of data from EEPROM. |
| ReadLargeSRAM | This function reads a block of data from SRAM. |
| ReadPulsedInputCounter | This function reads the pulsed input counter on the specified input. |
| ReadSRAM | This function reads a block of data from SRAM. |
| Receive | This function requests any data that has been received on the requested serial port (PORT_A or PORT_B). |
| Receive9BitData | This function is the same as Receive() above, but must be used if 9-bit serial reception is required. |
| ReceiveByteWidthTimeStamp9BitData | This function is the same as ReceiveByteWithTimestamp() above, but must be used if 9-bit serial reception. |
| ReceiveByteWithTimeStamp | If a byte has been received on the requested serial port, the byte is returned (rxByte) along with the. |
| ReceivePolledMessage | This function returns a received message stored in the buffer. |
| ReelSynchroniseEnable | This function is used to synchronise the reel position counter. |
| ReleaseParallelHopperCoins | This function is now obsolete. This function is used to release coins from a parallel hopper device. |
| ReleaseParallelHopperCoinsEx | *** NOT IMPLEMENTED *** This function is used to release coins from a parallel hopper device. |
| RelockHardware | Relock the board security functions. |
| ResetPulsedInputCounter | This function resets (sets to zero) the pulsed input counter on the specified input. |
| Send | This function sends data for serial transmission to the requested port (PORT_A or PORT_B). |
| Send9BitData | This function is the same as Send() above, but must be used if 9-bit serial transmission is required. |
| SendSEC | This function provides communications to a SEC (Starpoint Electronic Counter) device. |
| SendSPI | This function provides communications to a SPI device. |
| SetAuxOutputs | SetAuxOutputs:int( set:int, reset:int ) |
| SetClock | This function sets an internal clock to any required value. The clock will then be updated every second. The. |
| SetConfig | This function configures the requested serial port (PORT_A or PORT_B). |
| SetDutyCycle | Program the duty cycle timing for a specified stepper motor. |
| SetOffPeriodOutputBit | This function determines the state of an individual output bit. |
| SetOnPeriodOutputBit | This function behaves in the same way as SetOnPeriodOutputs() |
| SetOutputBrightness | This function determines the brightness for output lamps. |
| SetOutputs | Function name: SetOutputs() |
| SetPicSerialNumber | Set the PIC serial number, (can only be used once). |
| SetPolledHostTimeout | This function sets a host activity timeout. |
| SetTimeoutMessage | This function allows a time out to be defined and an associated message that should be sent if the timeout. |
| SpinRampDown |
This command must be issued for reel number |
| SpinRampUp |
This command must be issued for reel number |
| SpinReels | This function will spin a stepper motor. |
| StartSecuritySwitchRead | Calling this function ensures that the next NextSecuritySwitchRead() call will return the most recent result. |
| StopHopperCoinRelease | *** NOT IMPLEMENTED *** Stop the release of coins from a parallel hopper. |
| WriteEEPROM | This function writes a block of memory to the EEPROM. |
| WriteLargeSRAM | This function writes a block of memory to the SRAM. |
| WriteSRAM | This function writes a block of memory to the SRAM. |
| Field errors:String[] = [ "USB_MESSAGE_EXECUTION_SUCCESS", "USB_MESSAGE_NOT_RECOGNISED:Int", "USB_MESSAGE_LENGTH_ERROR", "USB_MESSAGE_EXECUTION_FAILURE", "USB_DEVICE_WRITE_ERROR", "USB_DEVICE_READ_ERROR", "USB_DEVICE_RESPONSE_ERROR", "USB_DEVICE_BYTE_COUNT_ERROR", "USB_MESSAGE_PARAMETER_OUT_OF_RANGE", "USB_MESSAGE_UNKNOWN_HANDSHAKE_MODE", "USB_MESSAGE_ILLEGAL_BAUD_RATE", "USB_MESSAGE_UNKNOWN_SERIAL_PROTOCOL", "USB_MESSAGE_I2C_NACK", "USB_MESSAGE_I2C_ERROR", "USB_MESSAGE_EXECUTION_TIMEOUT", "USB_MESSAGE_SRAM_ADDRESSING_ERROR", "USB_MESSAGE_REEL_NUMBER_ERROR", "USB_MESSAGE_REEL_BUSY", "USB_MESSAGE_SPIN_TABLE_LENGTH_ERROR", "USB_MESSAGE_TOO_FEW_REEL_STEPS", "USB_MESSAGE_REEL_STATUS_LENGTH_ERROR", "USB_MESSAGE_SYNC_REQUEST_LENGTH_ERROR", "USB_MESSAGE_PIPE_UNAVAILABLE", "USB_MESSAGE_RANDOM_GENERATOR_DISABLED", "USB_MESSAGE_PIPE_CURRENTLY_USED", "USB_MESSAGE_FUNCTION_NOT_SUPPORTED_ON_X10", "USB_MESSAGE_FUNCTION_NOT_SUPPORTED_ON_X10I", "USB_MESSAGE_SAS_ADDRESS_INTERRUPT", "USB_MESSAGE_TRY_AGAIN", "USB_MESSAGE_PARALLEL_INPUT_CURRENTLY_ACTIVE", "USB_MESSAGE_ILLEGAL_POINTER", "USB_MESSAGE_FUNCTION_NOT_SUPPORTED_ON_X15", "USB_MESSAGE_SMARTCARD_SW1SW2_ERROR", "USB_MESSGAE_PIC_BUSY", "USB_MESSAGE_PIC_BUFFER_FULL", "USB_MESSAGE_RECORDING_IN_PROGRESS", "USB_MESSAGE_RECORDING_NOT_CONFIGURED", "USB_MESSAGE_DEBUG_MSG" ] | |
| Description | Human readable errors to use with the returned error code. |
| Field fittedBoard:Byte |
| Method BeginPulsedInputCheck:Int( usbInputBitId:Byte Ptr ) | |
| Description | This function begins pulsed input counting on the specified input. |
| Information | A call to ConfigurePulsedInput() must be made first. The parameter Function Prototype BeginPulsedInputCheck:int( usbInputBitId inputBitID ) |
| Method CachedReadAndResetSecuritySwitchFlags:Int( closedSwitches:Byte Ptr, openSwitches:Byte Ptr ) | |
| Description | This function is a fast version of ReadAndResetSecuritySwitchFlags( ), |
| Information | recommended if real time performance is important in your code. The functionality is slightly different in that the previous instead of the current security switch status is returned. If a switch change occurs, then two calls to CachedReadAndResetSecuritySwitchFlags( ) would be required before the change is visible. The majority of X-line API calls work at relatively high speeds, limited mainly by USB transfer constraints (4ms per message). Security Pipe functions work at slow speeds because the onboard PIC performs the processing for these operations via a slow I2C bus. When the function ReadAndResetSecuritySwitchFlags( ) is called, the following events occur:
CachedReadAndResetSecuritySwitchFlags( ) changes the above sequence as follows:
Stages 2 and 3 are reversed and the previous security switches are immediately returned to the PC. If the function is called again before stage 3 is complete then the response will be delayed until stage 3 is complete from the previous call. It is therefore recommended that a minimum of a one second gap should occur between calls to CachedReadAndResetSecuritySwitchFlags( ). Function Prototype Programming Considerations |
| Method CheckEEPROM:Int( eepromConfig:X10EEPROM ) | |
| Description | This function attempts to detect the currently fitted EEPROM. |
| Information | It can differentiate between the following devices: 24LC01, 24LC02, 24LC04, 24LC08, 24LC16, 24LC32, 24LC64, 24LC128, 24LC256 and 24LC512. The function requires a single parameter, Type x10EEPROM Field pageSize:Byte ' e.g. For 24LC04 value = 16 Field numAddressBytes:Byte ' e.g. For 24LC04 value = 1 Field maxAddress:Short ' e.g. For 24LC04 value = 511 Field i2cAddress:Byte ' e.g. For 24LC04 value = 0x50 EndType The The The The Calls to CheckEEPROM() and ConfigureEEPROM() are automatically made during X-line board initialisation in an attempt to detect and configure the currently fitted EEPROM. Function Prototype |
| Method ClearSecuritySwitches:Int() | |
| Description | Calling this function will clear the security switch buffer. See the NextSecuritySwitchRead() function for. |
| Method Close() | |
| Description | Close() |
| Information | needs documenting??? |
| Method ConfigureCCTalkPort:Int( port:Int, cctalk_config:CCTalkConfig ) | |
| Description | This function configures a device on a port (A or B) for ccTalk Mode 1 operation. |
| Information | For a more detailed description of ccTalk Mode 1, please refer to ccTalk explanation describe further in this manual.. It is possible to set up to 8 ccTalk devices on an X-line board: 4 on Port A and 4 on Port B. Once a Port has been set up for ccTalk Mode 1 operation, only the following serial API functions are available for that port:
It is possible to call SetConfig() to re-configure the port to RS232/RS232 Polled/ccTalk Mode 0 operation if required. Two parameters are required for this function: The The Type CCTalkConfig Field device_number:Byte Field PollMethod:Byte Ptr Field next_trigger_device:Byte Field poll_retry_count:Byte Field polling_interval:Int Field max_response_time:Short Field min_buffer_space:Byte Field poll_msg[MAX_POLL_MSG_LENGTH] Field inhibit_msg[MAX_POLL_MSG_LENGTH] EndType The The The The The The The The The Once these parameters have been defined, automatic polling will commence if Polling stops automatically once the space left in the buffer falls below a certain level. It also stops if a
response timeout occurs and the maximum number of retries has been reached, as defined in
Note: (1) is needed because an inhibit message will have been sent to the device. If a device is configured for polling and that device triggers another device, and from that possibly more devices, there are some points to be aware of. If one of the devices becomes inhibited, or if it is reconfigured with the Disabled option, then that device and all devices triggered after it will cease polling. If it is reconfigured to the Once option, it will poll once and all other devices triggered after it once. Function Prototype Programming Considerations This function is only available in ccTalk Mode 1. |
| Method ConfigureEEPROM:Int( eepromConfig:X10EEPROM ) | |
| Description | This function allows the user to override automatic EEPROM detection (see CheckEEPROM( )). |
| Information | The function requires a single parameter, Function Prototype |
| Method ConfigurePulsedInputEx:Int( usbInputId:Byte Ptr, pulseLowerTime:Byte, pulseUpperTime:Byte, inputActiveState:Byte Ptr ) | |
| Description | configure reading of input pulses on parallel devices. |
| Information | This function is used to configure reading of input pulses on parallel devices, for example coin acceptors. The following functions are used in conjunction with this function: BeginPulsedInputCheck() Pulse reading will not begin until a call to BeginPulsedInputCheck() is made. The parameter The parameter The parameter Function Prototype ConfigurePulsedInputEx:int( usbInputBitId inputBitID, BYTE pulseLowerTime, ActiveState inputActiveState ) Programming Considerations This function is only supported on the X10i and X15 boards. It is not supported on the X10 board. |
| Method ConfigureReelsEx:Int( numberOfReels:Byte, halfStepsPerTurn:Short, stepsPerSymbol:Byte ) | |
| Description | This function must be called if stepper motors are to be controlled by the X-line board. |
| Information | This function must be called if stepper motors are to be controlled by the X-line board. The parameters determine the number of reels fitted (up to 3, identified as reel 0, reel 1 and reel 2), the number of positions per turn and the number of steps per symbol. (Note: One step is two positions when full stepping, but only one position when half stepping). At power up, the USB board will initialise with no reels fitted until this function has been called. The function may be called with the number of reels set to 0 to disable the reel function and return associated outputs to their normal operation. If, for example, only one reel is configured, then the outputs that would be associated with the two unused reel positions will behave as normal outputs. The system is, therefore, quite flexible. Note: There is no flexibility in allocation of particular outputs to particular reels: if one reel is configured, it will use outputs OP16/17/18/19 and input IP6. The second reel, if configured, will use outputs OP20/21/22/23 and input IP7. The third reel, if configured, will use outputs OP24/25/26/27 and input IP8. Function calls such as SetOutputs(), will not corrupt outputs configured for use by reels if they try to access them. Function calls such as GetInputs(), will read and return inputs correctly, whether configured for use with reels or not. The The Function Prototype Programming Considerations |
| Method ConfigureRS232Poll:Int( port:Int, pollConfig:RS232PollConfig ) | |
| Description | This function configures a device on a port (A or B) for RS232 Polled operation. |
| Information | RS232 Polled Mode is very similar to ccTalk Mode 1 but with several differences:
Apart from these differences, operation is identical to ccTalk Mode 1. Please read the section ConfigureCCTalkPort() for more details. It is possible to set up to 8 polled RS232 devices on an X-line board: 4 on Port A and 4 on Port B. Once a Port has been set up for RS232 Polled operation, only the following serial API functions are available for that port:
It is possible to call SetConfig() to re-configure the port to RS232/ccTalk Mode 0/ccTalk Mode 1 operation if required. Two parameters are required for this function: The The Type RS232PollConfig Byte device_number:Byte pmethod:PollMethod next_trigger_device:Byte poll_retry_count:Byte polling_interval:Int remove_local_echo:Int length_byte_offset:Byte add_to_length_byte:Byte max_response_time:Short min_buffer_space:Byte poll_msg:Byte[MAX_POLL_MSG_LENGTH] inhibit_msg:Byte[MAX_POLL_MSG_LENGTH] EndType The variables The The The Function Prototype Programming Considerations The function SetConfig() must be called first to ensure that the serial port is correctly configured and set to PORT_RS232_POLLED operation. This function is only available in RS232 Polled Mode. |
| Method Create:TX10iBoard( key:Byte Ptr ) | |
| Description | Create a TX10iBoard object. |
| Information | Create a TX10iBoard object and initalise / authenticate it. |
| Method DecrementPulsedInputCounter:Int( usbInputId:Byte Ptr ) | |
| Description | This function decrements the pulsed input counter on the specified input. |
| Information | If the counter is currently zero then no decrement will occur. A call to ConfigurePulsedInput() must be made first. The parameter Function Prototype DecrementPulsedInputCounter:int( usbInputBitId inputBitID ) |
| Method DeletePolledMessage:Int( port:Int, deviceNumber:Byte ) | |
| Description | This function deletes the first message stored in the buffer. |
| Information | Two parameters are required for this function: The The Function Prototype Programming Considerations This function is only available in RS232 Polled Mode or ccTalk Mode 1. |
| Method DisableSPI:Int() | |
| Description | This function disables the SPI protocol. |
| Information | This releases the X-line SPI outputs OP0 and OP1 for use by other functions. Function Prototype |
| Method EmptyPolledBuffer:Int( port:Int, deviceNumber:Byte ) | |
| Description | This function empties the receive buffer for the specified device. |
| Information | Two parameters are required for this function: The The Function Prototype Programming Considerations This function is only available in RS232 Polled Mode or ccTalk Mode 1. |
| Method EnableSPI:Int() | |
| Description | This function initialises the SPI (Serial Peripheral Interface) protocol. |
| Information | A call must be made to this function before using any SPI commands. The SPI protocol uses two X-line outputs for device communications: OP0 for the clock and OP1 for data output. Once the SPI protocol is enabled then these outputs can only be used for SPI commands. A call to DisableSPI() must be made to free up these outputs. The X-line input IP18 is also used as a data input from the SPI device. Function Prototype |
| Method Get8051Version:String() | |
| Description | Return the 8051 version as a string. |
| Information | This function reports the version number of the 8051 software. This is downloaded to the X-line device during enumeration. Function Prototype Get8051Version:String() Programming Considerations This returns a string of no more than 10 characters including the null terminator. The Memory pipe is used for this function. |
| Method GetBoardSpeed:Int() | |
| Description | Return the USB speed the board is connected at. |
| Information | The X10i/X15 boards can work at two different speeds: If the board is plugged into a USB 1.1 hub Then it will work at “full speed”, and if it is plugged into a USB 2 hub then it will work at “high speed”. High speed is considerably faster than full speed and this allows many X10i functions to perform faster. The X10 board can only work in “full speed” mode. Plugging it into a USB 1.1 or a USB 2 hub makes no difference. This function returns the speed at which the currently fitted board is working at. Function Prototype Programming Considerations Three possible values can be returned:
|
| Method GetClock:Int( time:Int Ptr ) | |
| Description | This function returns the time, in seconds, as set using SetClock(), plus the number of seconds that have. |
| Method GetDallasSerialNumber:String() | |
| Description | Return the dallas serial number as a string. |
| Information | This function reports the serial number of the Dallas chip on the X-line board. Every board has a unique serial number. The first byte returned is the family code of 0x01. The next 6 bytes are a unique serial number and the final 8th byte is a CRC byte. Although the CRC byte is made available to the user, the data has already been tested for integrity using the CRC and the result is returned in crcValid. GetDallasSerialNumber() is a slow Security Pipe function. Function Prototype GetDallasSerialNumber:String() Programming Considerations This returns a string of 8 bytes in serialNumberDallas. It sets crcValid = TRUE if the data passes the 8-bit CRC test. This function is only supported on the X10i and X15 boards. It is not supported on the X10 board. |
| Method GetDllVersion:String() | |
| Description | Return the dll version as a string. |
| Information | This function reports the version of the Windows DLL that is providing access to the USB device. It may be used to check that the correct DLL has been installed and is being called. It does not require a device handle and can be called without a USB device connected. Programming Considerations This returns a string of no more than 10 characters including the null terminator. No pipes are used for this function. |
| Method GetFittedBoard:Int( fittedBoard:Byte Ptr ) | |
| Description | This function is ascertains which board is currently fitted. |
| Information | This function is ascertains which board is currently fitted. Function Prototype Programming Considerations Four values can be returned:
|
| Method GetInputs:Int( button:Int, raw:Int ) | |
| Description | GetInputs:int( button:int, raw:int ) |
| Information | needs documenting??? |
| Method GetLastError:Int() | |
| Description | Return the error code for the last function call. |
| Information | This function returns the error code for the last function call that failed and updated the error code. Function Prototype usbErrorCode GetLastError() Return value A variable of type usbErrorCode that describes the reason for failure, also see chapter on API Return Codes. Programming Considerations Not all failing function calls have an error code associated with them, in which case the error code returned, if requested, will relate to a previous function call that failed. |
| Method GetMultiplexedInputs:Int( inputs:usbMultiplexedInput ) | |||||||||||||||||||||||||||||||
| Description | Return the multiplexed inputs. | ||||||||||||||||||||||||||||||
| Information | The use of multiplexed input lines is outlined in the following diagram. Note that blocking diodes must be fitted to each switch-line used to prevent channels from interfering with one another. The function GetMultiplexedInputs returns the state of the multiplexed inputs. The data is returned as the following type definition Type usbMultiplexedInput Field byMuxStatus:Byte Field byMuxInp:Byte[4,3] EndType The structure member byMuxStatus indicated the status of the input multiplexer. A non-zero value means that the input multiplexer in enabled, a zero value means that the input multiplexer is disabled. The structure member byMuxInp contains the status of each input pin for each channel. There are four channels each containing all 24 inputs IP0-IP23 (24 bits = 3 bytes). There are 4 channels and each channel is controlled by one of output pins 12, 13, 14 or 15 as shown in the diagram. For the first 1mS time slice, output 12 is toggled low while outputs 13, 14, and 15 are set high. Input lines IP0-IP23 are read and stored as channel 0. Next output 12 is toggled high and output 13 is toggled low and the 24 input bits stored as channel 1. This procedure is repeated until all input channel have been read, as summarised in the table below. Effectively each individual multiplexed input channel is read once every 4mS.
Function Prototype GetMultiplexedInputs:int( inputs:usbMultiplexedInput ) | ||||||||||||||||||||||||||||||
| Method GetParallelHopperStatus:Int( inputBit:Byte Ptr, status:Byte Ptr, coinsReleased:Byte Ptr ) | |
| Description | *** NOT IMPLEMENTED *** Read the parallel hopper coin release status after a call to ReleaseParallelHopperCoins(). |
| Information | This function reads the parallel hopper coin release status after a call to ReleaseParallelHopperCoins() has been made. The parameter The parameter The parameter Function Prototype |
| Method GetParityErrors:Int( port:Int, parityErrors:Short Ptr ) | |
| Description | This function returns the number of bytes received with a parity error. |
| Information | This value is reset after it is returned. The ‘parityErrors’ parameter is a pointer to a WORD where the parity error count will be returned. Function Prototype Programming Considerations |
| Method GetPICSerialNumber:String() | |
| Description | Return the PIC serial number as a string. |
| Information | This function reports the serial number of the PIC (which is blank when supplied by Heber). If the serial number is not set by the user (using SetPICSerialNumber) then this function will return a random 8 character string. The security of the PIC is controlled by unlockio.lib and this serial number is not related to the security. Function Prototype GetPICSerialNumber:String() Programming Considerations This returns a string of no more than 9 characters including the null terminator. |
| Method GetPICVersion:String() | |
| Description | Return the PIC version number as a string. |
| Information | This function reports the version of X-line PIC (security device) firmware. Function Prototype GetPICVersion:string() Programming Considerations This returns a string of no more than 10 characters including the null terminator. |
| Method GetProductVersion:String() | |
| Description | Return the product version as a string. |
| Information | This function reports the X-line Development Suite Product version. Function Prototype BOOL GetProductVersion:String() Programming Considerations This returns a string of no more than 10 characters including the null terminator. No pipes are used for this function. |
| Method GetPulsedInputStatus:Int( usbInputBitId:Byte Ptr, jamStatus:Byte Ptr, inputCounterValue:Byte Ptr ) | |
| Description | This function reports the “jammed” status of a parallel input. |
| Information | An input becomes jammed if the pulse has exceeded it’s upper limit (as defined in ConfigurePulsedInputEx()). Once an input is jammed then further pulses (whether valid or not) will not be recorded. The parameter The pointer parameter The pointer parameter Function Prototype GetPulsedInputStatus:int( usbInputBitId inputBit, BOOL *jamStatus, BYTE *inputCounterValue ) |
| Method GetReelStatus:Int( status:Byte Ptr ) | |
| Description | This function is now obsolete. The Function GetReelStatusEx() (documented in the next section) should be used instead. |
| Information | This function returns the reel status for all reels, even only some of the reel outputs are configured as
reels. The data returned in the
Function Prototype Programming Considerations This function is now obsolete because the reel position and error are stored as BYTE’s. Please use GetReelStatusEx() instead, because the reel position and error are stored as WORD’s – this accommodates 200 step reels. Note: On a reels initial spin the position field data is invalid until the X-line board has detected the presence of the opto flag and the synchronised field has been set. |
| Method GetReelStatusEx:Int( ) | |
| Description | his function returns the reel status for all reels. |
| Information | This function returns the reel status for all reels, even if not all reels are configured active. The data
returned in the
Note: On a reels initial spin the position field data is invalid until the X10i has detected the presence of the opto flag and the synchronised field has been set. This function is now recommended instead of GetReelStatus() because the reel position and error are now stored as WORD’s instead of BYTE’s. This accommodates 200 step reels. Function Prototype Programming Considerations |
| Method InputMultiplexing:Int( usbInputMultiplexing:Int ) | |
| Description | Enable or Disable Multiplexing. |
| Information | This function is used to either enable or disable input multiplexing. Once enabled then outputs OP12, OP13, OP14 and OP15 are used exclusively to strobe the input multiplexer. Each output is sequentially pulsed low for 1mS and the inputs are read and stored at the end of the pulse. The parameter Function Prototype InputMultiplexing:int( usbInputMultiplexing:int ) |
| Method NextSecuritySwitchRead:Int( time:Int Ptr, switches:Byte Ptr ) | |
| Description | Read security switch state. |
| Information | Four security switch inputs are continuously monitored. Each time they change state, the new state is stored in a circular buffer with a time stamp from the real time clock. The time stamp format is the same as the real time clock format. The switch locations are:
The buffer can store up to ten readings. Each call to this function returns the next oldest result. The buffer is circular, so the results will repeat after 10 function calls. Reading of switches and storing of results occurs, whether the USB board is powered or not. Function Prototype |
| Method ReadAndResetSecuritySwitchFlags:Int( closedSwitches:Byte Ptr, openSwitches:Byte Ptr ) | |
| Description | This function returns the security switch flags that have opened and closed since the last time the. |
| Method ReadEEPROM:Int( address:Short, data:Byte Ptr, totalLength:Int ) | |
| Description | This function reads a block of data from EEPROM. |
| Information | The parameter specifies the start address to read from.The parameter is a pointer to a block of data in which the EEPROM data will be written. The user
must allocate this memory before calling this function. The amount of memory allocated must also be at
least as much as specified in the The Function Prototype Programming Considerations |
| Method ReadLargeSRAM:Int( address:Int, data:Byte Ptr, totalLength:Short ) | |
| Description | This function reads a block of data from SRAM. |
| Information | Function Prototype Programming Considerations This function is only supported on the X10i and X15 boards. It is not supported on the X10 board. |
| Method ReadPulsedInputCounter:Int( usbInputBitId:Byte Ptr, inputCounterValue:Byte Ptr ) | |
| Description | This function reads the pulsed input counter on the specified input. |
| Information | A call to ConfigurePulsedInput() must be made first. The parameter The parameter Function Prototype ReadPulsedInputCounter:int( usbInputBitId inputBitID, BYTE *inputCounterValue) |
| Method ReadSRAM:Int( address:Short, data:Byte Ptr, totalLength:Int ) | |
| Description | This function reads a block of data from SRAM. |
| Information | The parameter specifies the start address to read from.The parameter is a pointer to a block of data in which the SRAM data will be written. The user
must allocate this memory before calling this function. The amount of memory allocated must also be at
least as much as specified in the The Function Prototype Programming Considerations |
| Method Receive:Int( port:Int, data:Byte Ptr, length:Int Ptr ) | |
| Description | This function requests any data that has been received on the requested serial port (PORT_A or PORT_B). |
| Information | The length parameter indicates how many bytes were received. Function Prototype Programming Considerations The function SetConfig() must be called first to ensure that the serial port is correctly configured. This function is not available in RS232 Polled Mode or ccTalk Mode 1. |
| Method Receive9BitData:Int( port:Int, data:Short Ptr, length:Int Ptr ) | |
| Description | This function is the same as Receive() above, but must be used if 9-bit serial reception is required. |
| Information | SetConfig() must have set Parity to DATA_BIT_9PARITY for this function to work correctly. Function Prototype Programming Considerations See Receive() above. |
| Method ReceiveByteWidthTimeStamp9BitData:Int( port:Int, rxWord:Short Ptr, interval:Byte Ptr, received:Int Ptr ) | |
| Description | This function is the same as ReceiveByteWithTimestamp() above, but must be used if 9-bit serial reception. |
| Method ReceiveByteWithTimeStamp:Int( port:Int, rxByte:Byte Ptr, interval:Byte Ptr, received:Int Ptr ) | |
| Description | If a byte has been received on the requested serial port, the byte is returned (rxByte) along with the. |
| Method ReceivePolledMessage:Int( port:Int, deviceNumber:Byte, data:Byte Ptr, length:Int Ptr, inhibited:Int Ptr ) | |
| Description | This function returns a received message stored in the buffer. |
| Information | The buffer is a FIFO (first in, first out) and is 600 bytes long. The message remains in the buffer until a call to DeletePolledMessage() is made. This is required to preserve the message in case power loss occurs. The parameters for this function are described as follows: The The The parameter is a pointer to a buffer where the received message will be stored. The The Function Prototype Programming Considerations This function is only available in RS232 Polled Mode or ccTalk Mode 1. |
| Method ReelSynchroniseEnable:Int( reelNumber:Byte ) | |
| Description | This function is used to synchronise the reel position counter. |
| Information | A synchronisation flag (state) is used to control initialisation of the reel position counter. After power-up or a call to ReelSynchroniseEnable(), the synchronisation state will be FALSE. The reels must be configured using ConfigureReels (), then ramp tables must be defined for each reel using SpinRampUp() and SpinRampDown() functions. Finally, each reel is spun through at least one turn using SpinReels(). A call to GetReelStatus() should show that each reel is now synchronised with zero error count. Synchronisation state: When FALSE, the reel position counter will be set to 0 as the opto-detector is passed, and the synchronisation state will be set to TRUE. When TRUE, the position counter will be copied into the error counter as the opto-detector is passed and the synchronisation state will remain set to TRUE. It can only be set to FALSE again by ReelSynchroniseEnable(). Function Prototype Programming Considerations Note: Reels will only synchronise when the reel spins past the position-0 opto-detector while spinning forwards (positive direction/step size value). |
| Method ReleaseParallelHopperCoins:Int() | |
| Description | This function is now obsolete. This function is used to release coins from a parallel hopper device. |
| Information | This is a non-blocking function, so in order to read the release status a call to GetParallelHopperStatus() must be made. This function works by setting a specified output high – this will turn the coin hopper motor on and start to release coins. Simultaneously an input is read counting off pulses – these pulses equate to released coins. If all the required coins are not released, and a specified timeout occurs, it will be assumed that an error has occurred. In this event the output will be set low (turning off the hopper motor) and an error will be returned – see function GetParallelHopperStatus(). The parameter The parameter The parameter
Note: If the input is already active and a call to ReleaseParallelHopperCoins() is made, an error will not be returned, but the ReleaseHopperCoinsStatus shall be set to return the status InitJam when calling function GetParallelHopperStatus() (only on an X10i or X15). The parameter The parameter The parameter Even after the required number of coins have been released, the board will continue to count coins on the designated input. Call EndPulsedInputCheck() to stop the counter. Function Prototype ReleaseParallelHopperCoins( usbInputBitId inputBit, BYTE pulseLowerTime, ActiveState inputActiveState UsbOutputBitId outputBit, WORD coinTimeout, BYTE coinsToRelease ) Programming Considerations This function has been deprecated. You should use ReleaseParallelHopperCoinsEx() instead. |
| Method ReleaseParallelHopperCoinsEx:Int( usbInputBitId:Byte Ptr, pulseLowerTime:Byte, pulseUpperTime:Byte, inputActiveState:Byte Ptr, outputBit:Byte Ptr, coinTimeOut:Short, coinsToRelease:Byte ) | |
| Description | *** NOT IMPLEMENTED *** This function is used to release coins from a parallel hopper device. |
| Information | This is a non-blocking function, so in order to read the release status a call to GetParallelHopperStatus() must be made. This function works by setting a specified output high – this will turn the coin hopper motor on and start to release coins. Simultaneously an input is read counting off pulses – these pulses equate to released coins. If all the required coins are not released, and a specified timeout occurs, it will be assumed that an error has occurred. In this event the output will be set low (turning off the hopper motor) and an error will be returned – see function GetParallelHopperStatus(). The parameter The parameter The parameter Note: If the maximum pulse width is exceeded then the motor will be turned off and the status (when calling GetParallelHopperStatus()) will be set to Jam. The parameter
Note: If the input is already active and a call to ReleaseParallelHopperCoinsEx() is made, the status (when calling GetParallelHopperStatus()) will be set to InitJam. The parameter The parameter The parameter Even after the required number of coins have been released, the X-line board will continue to count coins on the designated input. Call EndPulsedInputCheck() to stop the counter. Function Prototype ReleaseParallelHopperCoinsEx:int( usbInputBitId inputBit, BYTE pulseLowerTime, BYTE pulseUpperTime, ActiveState inputActiveState UsbOutputBitId outputBit, WORD coinTimeout, BYTE coinsToRelease ) Programming Considerations This function replaces the deprecated function ReleaseParallelHopperCoins(). |
| Method RelockHardware:Int() | |
| Description | Relock the board security functions. |
| Method ResetPulsedInputCounter:Int( usbInputId:Byte Ptr ) | |
| Description | This function resets (sets to zero) the pulsed input counter on the specified input. |
| Information | A call to ConfigurePulsedInput() must be made first. The parameter Function Prototype ResetPulsedInputCounter:int( usbInputBitId inputBitID ) |
| Method Send:Int( port:Int, data:Byte Ptr, length:Int ) | |
| Description | This function sends data for serial transmission to the requested port (PORT_A or PORT_B). |
| Information | The function is blocking” and will not return control until the transmission has completed or has failed. Therefore the delay at low baud rates could be lengthy. The length parameter indicates how many bytes must be transmitted. A buffered (“non-blocking”) version of this function that allows transmission of data as a background task may be developed in future. Function Prototype Programming Considerations this function is not available in RS232 Polled Mode or ccTalk Mode 1. |
| Method Send9BitData:Int( port:Int, data:Short Ptr, length:Int ) | |
| Description | This function is the same as Send() above, but must be used if 9-bit serial transmission is required. |
| Information | SetConfig() must have set Parity to DATA_BIT_9PARITY for this function to work correctly. Function Prototype Programming Considerations |
| Method SendSEC:Int( command:Byte, id:Byte, numberOfTxBytes:Byte, txMessage:Byte Ptr, waitTimeMs:Byte, numberOfRxBytes:Byte, rxMessage:Byte Ptr ) | |
| Description | This function provides communications to a SEC (Starpoint Electronic Counter) device. |
| Information | This function handles all message formatting and checksum creation automatically. The The The The The The The Function Prototype Programming Considerations There is a size limit of 16 bytes for both transmit and receive messages. |
| Method SendSPI:Int( numberOfTxBits:Byte, txMessage:Byte Ptr, waitTimeMs:Byte, numberOfRxBits:Byte, rxMessage:Byte Ptr ) | |
| Description | This function provides communications to a SPI device. |
| Information | Only SPI mode 2 is supported. The The The The The Function Prototype Programming Considerations There is a size limit of 20 bytes (160 bits) on both transmit and receive messages. |
| Method SetAuxOutputs:Int( set:Int, reset:Int ) | |
| Description | SetAuxOutputs:int( set:int, reset:int ) |
| Information | needs documenting??? |
| Method SetClock:Int( time:Int ) | |
| Description | This function sets an internal clock to any required value. The clock will then be updated every second. The. |
| Method SetConfig:Int( port:Int, config:DCB, _type:Int ) | |
| Description | This function configures the requested serial port (PORT_A or PORT_B). |
| Information | The The fOutxCtsFlow indicates whether the CTS (clear-to-send) signal is monitored for output flow control. If this member is TRUE and CTS is turned off, output is suspended until CTS is sent again. fParity is not used. Parity checking is automatically enabled if Parity (see below) is set to ODDPARITY or EVENPARITY. Parity sets the parity method. This can be set to the following values: NOPARITY (no parity), ODDPARITY (odd parity), EVENPARITY (even parity) or DATA_BIT_9PARITY (parity bit is used for a ninth data bit). If this member is ODDPARITY or EVENPARITY, parity checking is performed and errors are reported using the function GetParityErrors(). Note: DATA_BIT_9PARITY is a special case. In this case, the ninth bit to be transmitted or received is an
additional data bit, not a parity bit. This mode can be set if Note: To send and receive 9 bit serial data, set Parity = DATA_BIT_9PARITY and use the following functions: Send9BitData(), Receive9BitData() or ReceiveByteWithTimestamp9BitData(). Do not use any other serial functions. Do not use these 9 bit functions with any other value of Parity. fRtsControl controls how handshaking is handled. This parameter is only relevant when in RS232 mode. The possible values for this member are described below: Value Description RTS_CONTROL_DISABLE Disables the RTS line when the device is opened and leaves it disabled. RTS_CONTROL_ENABLE Enables the RTS line when the device is opened and leaves it on. RTS_CONTROL_HANDSHAKE Enables RTS handshaking. The driver raises the RTS line when the “type-ahead” (input) buffer is less than one-half full and lowers the RTS line when the buffer is more than three-quarters full. If handshaking is enabled, it is an error for the application to adjust the line by using the EscapeCommFunction function. In this implementation, it is treated as RTS_CONTROL_TOGGLE below. RTS_CONTROL_TOGGLE Specifies that the RTS line will be high if bytes are available for transmission. After all buffered bytes have been sent, the RTS line will be low.
The Port B uses TTL levels and signal polarities and has no handshake lines. Therefore, Port B should be set to RTS_CONTROL_DISABLE when port-type is PORT_RS232 or PORT_RS232_POLLED. The idle condition for port-type PORT_RS232 and PORT_RS232_POLLED is a “1” or marking condition. For Port A, this will be –10V. For Port B, this will be +5V (i.e. TTL). Subject to configuration serial operation may need the presence of an external 12V power supply and may not work if the X-line’s only power source is USB bus power. The absence of an external 12V power supply can be inferred if the current sense input is true and all the parallel outputs are off. Function Prototype |
| Method SetDutyCycle:Int( reelNumber:Byte, offPeriod:Byte, onPeriod:Byte ) | |
| Description | Program the duty cycle timing for a specified stepper motor. |
| Information | This function programs the duty cycle timing for a specified reel. The duty cycle occurs when the reel is at rest. The argument The argument
The argument If the user does not explicitly execute this function, then a default duty cycle of 5ms off/5ms on will be
used. Function Prototype Programming Considerations |
| Method SetOffPeriodOutputBit:Int( usbOutputID:Int, bitNumber:Int, bitState:Int ) | |
| Description | This function determines the state of an individual output bit. |
| Information | This function determines the state of an individual output bit during the “off” period of the duty cycle. See the SetOnPeriodOutputBit() function description above. Function Prototype SetOffPeriodOutputBit:int( usbOutputID:Int, bitNumber:Int, bitState:int ) Programming Considerations The outputs are updated once every millisecond. Attempts to control outputs that have been assigned to reel stepper motor control will be accepted but ignored. |
| Method SetOnPeriodOutputBit:Int( usbOutputID:Int, bitNumber:Int, bitState:Int) | |
| Description | This function behaves in the same way as SetOnPeriodOutputs() |
| Information | This function behaves in the same way as SetOnPeriodOutputs() however it allows you to control individual output bits. The The The Function Prototype SetOnPeriodOutputBit:int( usbOutputID:int, bitNumber:int, bitState:int ) Programming Considerations The outputs are updated once every millisecond. Attempts to control outputs that have been assigned to reel stepper motor control will be accepted but ignored. |
| Method SetOutputBrightness:Int( brightness:Byte ) | |
| Description | This function determines the brightness for output lamps. |
| Information | This function determines the brightness for output lamps that have previously been defined using the functions SetOnPeriodOutputs, SetOffPeriodOutputs, SetOnPeriodOutputBit and SetOffPeriodOutputBit. The Function Prototype etOutputBrightness:int( brightness:Byte ) |
| Method SetOutputs:Int( set:Int, reset:Int ) | |
| Description | Function name: SetOutputs() |
| Information | Note: This function actually uses ModifyOutputs(), so a direct call to ModifyOutputs() will be slightly more efficient. It will continue to be supported. All of the outputs on the USB board may be controlled at once using this function call. The bytes set the outputs as follows (in the order in which they are sent): · OUTPUT_BIT_OP0-7 · OUTPUT_BIT_OP8-15 · OUTPUT_BIT_OP16-23 · OUTPUT_BIT_OP24-32 · OUTPUT_BIT_AUX0-7 Setting bits will turn the related outputs ON, clearing bits will turn the related outputs OFF. Function Prototype BOOL SetOutputs( LPBYTE outputs ); Programming Considerations The outputs are updated once every millisecond. Attempts to control outputs that have been assigned to reel stepper motor control will be accepted but ignored. This function is provided for legacy support only. Use the function SetOnPeriodOutputs( ) and the related functions (below) to control outputs. about: |
| Method SetPicSerialNumber:Int( serial:Byte[] ) | |
| Description | Set the PIC serial number, (can only be used once). |
| Information | This function sets the serial number for the PIC. The serial number is 8 characters long. This can only be used once. The security of the PIC is controlled by unlockio.lib and this serial number is not related to the security. Function Prototype SetPicSerialNumber:Int( serial:Byte[] ) |
| Method SetPolledHostTimeout:Int( port:Int, deviceNumber:Byte, timeout:Double ) | |
| Description | This function sets a host activity timeout. |
| Information | If the host software has not requested serial data (using ReceivePolledMessage()) for the defined timeout then the X-line board will inhibit the device. This function is useful for disabling money acceptors in the event of the host PC application crashing. Three parameters are required for this function:> The The The Function Prototype The function SetConfig() must be called first to ensure that the serial port is correctly configured and set to either PORT_RS232_POLLED or PORT_CCTALK_MODE1 operation. Also a call to ConfigureCCTalkPort() or ConfigureRS232Poll() must be made to configure this device. This function is only available in RS232 Polled Mode or ccTalk Mode 1. |
| Method SetTimeoutMessage:Int( port:Int, message:Byte Ptr, numBytes:Byte, timeout:Float ) | |
| Description | This function allows a time out to be defined and an associated message that should be sent if the timeout. |
| Method SpinRampDown:Int( reelNumber:Byte, rampDownTable:Byte[] ) | |
| Description | This command must be issued for reel number |
| Information | It defines how the reel will be ramped down. Each reel needs a ramp table (which may be different for each reel). Without a ramp table, reel behaviour will be unpredictable. The variable Each delay entry in the table has a maximum value of 255ms. For example, ramp table of {4,19,20,30,250} will specify a ramp of three steps of 19ms, 20ms and 30ms, followed by a period of 250ms at full power, after which the stepper motor power is reduced by chopping the stepper motor drive. |
| Method SpinRampUp:Int( reelNumber:Byte, rampUpTable:Byte[] ) | |
| Description | This command must be issued for reel number |
| Information | It defines how the reel will be ramped up. Each reel needs a ramp table (which may be different for each reel). Without a ramp table, reel behaviour will be unpredictable. The variable Each delay entry in the table has a maximum value of 255ms. For example, a ramp up table of {6,200,50,40,30,20,18} will specify a power-up delay of 200ms followed by a ramp of five steps of 50ms, 40ms, 30ms, 20ms and 18ms. It also defines the stepping rate to be used for the remainder of the spin until the reel is ready to ramp down: it will use the last entry in the table, which in this case is 18ms. Function Prototype Programming Considerations |
| Method SpinReels:Int( reelNumber:Byte, directionAndStepSize:Byte, steps:Short ) | |
| Description | This function will spin a stepper motor. |
| Information | This function will spin a stepper motor This command cannot be used until the ramp up and ramp down tables have been defined for the reel. Each reel has its own ramp up and ramp down tables. The number of steps must be greater than the number of steps that are required to perform a complete ramp up and ramp down, otherwise an error will report that not enough steps were requested. The minimum number of steps that can be moved is: “(number of steps in the ramp up table) + (number of steps in the ramp down table) – 1” This allows a single step (or single half-step) nudge by using ramp up and ramp down tables with one entry and a spin command of one step. See the sections below describing the ramp table commands for more information on ramps. The maximum number of steps that can be moved is 32767. Function Prototype Programming Considerations |
| Method StartSecuritySwitchRead:Int() | |
| Description | Calling this function ensures that the next NextSecuritySwitchRead() call will return the most recent result. |
| Method StopHopperCoinRelease:Int( inputBit:Byte Ptr ) | |
| Description | *** NOT IMPLEMENTED *** Stop the release of coins from a parallel hopper. |
| Information | This function will stop the release of coins from a parallel hopper by turning off the motor. The parameter Function Prototype StopHopperCoinRelease:int( usbInputBitId inputBit ) Programming Considerations This function is only supported on the X10i and X15 boards. It is not supported on the X10 board. |
| Method WriteEEPROM:Int( data:Byte, totalLength:Int ) | |
| Description | This function writes a block of memory to the EEPROM. |
| Information | The parameter specifies the start address to write to.The parameter is a pointer to a block of source data that will be written to EEPROM. The Function Prototype Programming Considerations |
| Method WriteLargeSRAM:Int( address:Int, data:Byte Ptr, totalLength:Short ) | |
| Description | This function writes a block of memory to the SRAM. |
| Information | Function Prototype Programming Considerations This function is only supported on the X10i and X15 boards. It is not supported on the X10 board. |
| Method WriteSRAM:Int( address:Short, data:Byte Ptr, totalLength:Int ) | |
| Description | This function writes a block of memory to the SRAM. |
| Information | The parameter specifies the start address to write to.The parameter is a pointer to a block of source data that will be written to SRAM. The Function Prototype Programming Considerations |
| Version | 0.10 |
|---|---|
| Author | Nigel Brown (http://www.heber.co.uk) |
| License | Copyright Heber Ltd |
| Modserver | BRL |
| CC_OPTS | -fexceptions |
| LD_OPTS | -L%PWD%/lib/win32 |
| LD_OPTS | -L%PWD%/lib/linux |