CASH.DLL
v4.1.1.6

Reference CASH.DLL

All function names have to be in capital letters.
To have always access to the DLL you should copy the CASH.DLL to the Windows SYSTEM directory!

QuickLinks: CASH-Interface   HOPPER-Interface   COUNTER-Board


CASH-Interface Functions:

CASH_OPENCOM
Parameter: CASH_COMPORT (0..255)
Opens the indicated COM-Port.
Returns: 1, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function CASH_OPENCOM(CASH_COMPORT: Integer): Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function CASH_OPENCOM Lib "CASH.DLL" (ByVal CASH_COMPORT As Long) As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function CASH_OPENCOM Lib "CASH.DLL" (ByVal CASH_COMPORT As Integer) As Integer



CASH_CLOSECOM
Parameter: none
Closes the previously opened COM-Port.
Returns: none

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Procedure CASH_CLOSECOM; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Sub CASH_CLOSECOM Lib "CASH.DLL" ()

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Sub CASH_CLOSECOM Lib "CASH.DLL" ()



CASH_READ
Parameter: none
Reads the Cash Interface on the previously opened COM-Port.
Returns: the state (Byte) of the indicated COM-Port, on error -1
Data byte format:
Bit1 = Channel 1
Bit2 = Channel 2
Bit3 = Channel 3
Bit4 = Channel 4
Bit5 = Channel 5
Bit6 = Channel 6
Bit7 = BUSY signal of the NVx
Bit8 = Power supply ok

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function CASH_READ: Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function CASH_READ Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function CASH_READ Lib "CASH.DLL" () As Integer



CASH_TOTALBLOCKING
Parameter: 0=TotalBlocking off, 1=TotalBlocking on
Deactivates the device for accepting money
Returns: 1, on error -1
Hint: Connecting the power supply the CASH-Interface is disabled and
        needs to be activated with the CASH_TOTALBLOCKING(0) command!


Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function CASH_TOTALBLOCKING(CASH_COMMAND: Integer): Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function CASH_TOTALBLOCKING Lib "CASH.DLL" (ByVal CASH_COMMAND As Long) As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function CASH_TOTALBLOCKING Lib "CASH.DLL" (ByVal CASH_COMMAND As Integer) As Integer



CASH_TOTALBLOCKING_ON
Parameter: none
Deactivates the device for accepting money
Returns: 1, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function CASH_TOTALBLOCKING_ON: Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function CASH_TOTALBLOCKING_ON Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function CASH_TOTALBLOCKING_ON Lib "CASH.DLL" () As Integer



CASH_TOTALBLOCKING_OFF
Parameter: none
Activates the device for accepting money
Returns: 1, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function CASH_TOTALBLOCKING_OFF: Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function CASH_TOTALBLOCKING_OFF Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function CASH_TOTALBLOCKING_OFF Lib "CASH.DLL" () As Integer



CASH_IN1
Parameter: none
Reads the status of input 1
Returns: 0 = input 1 open, 1 = input 1 closed, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Procedure CASH_IN1; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Sub CASH_IN1 Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Sub CASH_IN1 Lib "CASH.DLL" () As Integer

The monitoring of the inputs is only working if the CASH-Interface is ACTIVE,
that means it was activated either with TOTALBLOCKING(0) or TOTALBLOCKING_OFF




CASH_IN2
Parameter: none
Reads the status of input 2
Returns: 0 = input 2 open, 1 = input 2 closed, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Procedure CASH_IN2; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Sub CASH_IN2 Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Sub CASH_IN2 Lib "CASH.DLL" () As Integer

The monitoring of the inputs is only working if the CASH-Interface is ACTIVE,
that means it was activated either with TOTALBLOCKING(0) or TOTALBLOCKING_OFF



HOPPER-Interface Functions (since board v3.01):

HOPPER_OPENCOM
Parameter: HOPPER_COMPORT (0..255)
Opens the indicated COM-Port.
Returns: 1, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function HOPPER_OPENCOM(HOPPER_COMPORT: Integer): Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function HOPPER_OPENCOM Lib "CASH.DLL" (ByVal HOPPER_COMPORT As Long) As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function HOPPER_OPENCOM Lib "CASH.DLL" (ByVal HOPPER_COMPORT As Integer) As Integer



HOPPER_CLOSECOM
Parameter: none
Closes the previously opened COM-Port.
Returns: none

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Procedure HOPPER_CLOSECOM; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Sub HOPPER_CLOSECOM Lib "CASH.DLL" ()

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Sub HOPPER_CLOSECOM Lib "CASH.DLL" ()



HOPPER1_MOTOR_RUN
Parameter: none
Starts the Hopper 1 motor
Returns: 1, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function HOPPER1_MOTOR_RUN: Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function HOPPER1_MOTOR_RUN Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function HOPPER1_MOTOR_RUN Lib "CASH.DLL" () As Integer



HOPPER2_MOTOR_RUN
Parameter: none
Starts the Hopper 2 motor
Returns: 1, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function HOPPER2_MOTOR_RUN: Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function HOPPER2_MOTOR_RUN Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function HOPPER2_MOTOR_RUN Lib "CASH.DLL" () As Integer



HOPPER1_MOTOR_STOP
Parameter: none
Stops the Hopper 1 motor
Returns: 1, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function HOPPER1_MOTOR_STOP: Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function HOPPER1_MOTOR_STOP Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function HOPPER1_MOTOR_STOP Lib "CASH.DLL" () As Integer



HOPPER2_MOTOR_STOP
Parameter: none
Stops the Hopper 2 motor
Returns: 1, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function HOPPER2_MOTOR_STOP: Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function HOPPER2_MOTOR_STOP Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function HOPPER2_MOTOR_STOP Lib "CASH.DLL" () As Integer



HOPPER1_READ
Parameter: none
Reads directly the Hopper 1 coin signal on the previously opened COM-Port.
Returns: 0 = no coin, 1 = coin, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Procedure HOPPER1_READ; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Sub HOPPER1_READ Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Sub HOPPER1_READ Lib "CASH.DLL" () As Integer



HOPPER2_READ
Parameter: none
Reads directly the Hopper 2 coin signal on the previously opened COM-Port.
Returns: 0 = no coin, 1 = coin, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Procedure HOPPER2_READ; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Sub HOPPER2_READ Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Sub HOPPER2_READ Lib "CASH.DLL" () As Integer



HOPPER1_PAYOUT
Parameter: Coins (1..65535)
Payout coins
Returns: payed coins, on error the coins payed until the error did occur (e.g. hopper empty)

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function HOPPER1_PAYOUT(HOPPER_COINS: Integer): Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function HOPPER1_PAYOUT Lib "CASH.DLL" (ByVal HOPPER_COINS As Long) As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function HOPPER1_PAYOUT Lib "CASH.DLL" (ByVal HOPPER_COINS As Integer) As Integer



HOPPER2_PAYOUT
Parameter: Coins (1..65535)
Payout coins
Returns: payed coins, on error the coins payed until the error did occur (e.g. hopper empty)

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function HOPPER2_PAYOUT(HOPPER_COINS: Integer): Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function HOPPER2_PAYOUT Lib "CASH.DLL" (ByVal HOPPER_COINS As Long) As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function HOPPER2_PAYOUT Lib "CASH.DLL" (ByVal HOPPER_COINS As Integer) As Integer



HOPPER_IN1
Parameter: none
Reads the status of input 1.
Returns: 0 = input 1 open, 1 = input 1 closed, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Procedure HOPPER_IN1; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Sub HOPPER_IN1 Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Sub HOPPER_IN1 Lib "CASH.DLL" () As Integer



Tips to control the hopper

The function HOPPER_PAYOUT(coins) takes care of the payment fully automatically. The Hopper Motor is started and stopped again when the number of coins to be paid out is reached. If no coin signal is detected within 5 sec, for example when the hopper is empty, the hopper is stopped (time out supervision) and the paid out coins count is given back by the function. Disadvantage of the function HOPPER_PAYOUT is you have no report about the already paid out coins until the process has finished.

To get the number of paid coins in real time is also possible. The hopper motor is started with the function HOPPERx_MOTOR_START. At the same time the coin signal must be evaluated with the function HOPPERx_READ in a timer routine. In the timer routine you can monitor the coin signal in real time with HOPPERx_READ and count the coins payed. Reaching the coins number to be paid out stop the hopper with the function HOPPERx_MOTOR_STOP. To have a timeout supervision just use a second timer. Use for the HOPPERx_READ function a high resolution timer with a interval of 10ms !

Both solutions can be found in the example programs as complete source code.

If the hopper supports the PULSE mode you can control the hopper also with pulses. The hopper has to be set to PULSE mode by jumper or mode selector. The big advantage is the hopper does all the monitoring and payout stuff by itself. A simple pulse is sent to the hopper for every coin you want to pay out. To create a pulse you can use the function HOPPERx_MOTOR_START and HOPPERx_MOTOR_STOP . The pulse should be 100ms in length.
Example Delphi:
for i := 1 to Amount do begin
  HOPPER1_MOTOR_START;
  Sleep(100);
  HOPPER1_MOTOR_STOP;
  Sleep(100);
end;
Disadvantage PULSE mode: there is no report about the already paid out coins.

- Stop all other programm stuff while doing payouts
- Use a high resolution timer of 10ms to poll the HOPPERx_READ function (no default timer!).
- Maybe set the program priority to HIGH


Time delay while opening the COM-Port

The HOPPER-Interface has integrated a hardware time function which bridges the Windows interface test. On system boot the COM-Port is tested by the operating system and the lines go to HIGH for a short time. Without the time function the hopper would begin to pay out coins while the interface test is active. Because of the time function there is a small delay of approx. 2 seconds opening the COM-Port. Therefore the COM-Port to the hopper should be opened on program start so later the hoppers are ready without delay.

To control a second HOPPER-Interface without the time delay between switching the com port all hopper functions are in a _B2 (board2) version available.

HOPPER_B2_OPENCOM
HOPPER1_B2_MOTOR_RUN
HOPPER1_B2_MOTOR_STOP
HOPPER1_B2_READ
HOPPER1_B2_PAYOUT
HOPPER2_B2_MOTOR_RUN
HOPPER2_B2_MOTOR_STOP
HOPPER2_B2_READ
HOPPER2_B2_PAYOUT
HOPPER_B2_IN1
HOPPER_B2_CLOSECOM



Older HOPPER-Interface versions than v3.01

Use the CASH.DLL version 4.0.6.8 : CASH.DLL v4.0.6.8



COUNTER-Board Functions:

COUNTER_OPENCOM
Parameter: COUNTER_COMPORT (0..255)
Opens the indicated COM-Port.
Returns: 1, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function COUNTER_OPENCOM(COUNTER_COMPORT: Integer): Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function COUNTER_OPENCOM Lib "CASH.DLL" (ByVal COUNTER_COMPORT As Long) As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function COUNTER_OPENCOM Lib "CASH.DLL" (ByVal COUNTER_COMPORT As Integer) As Integer



COUNTER_CLOSECOM
Parameter: none
Closes the previously opened COM-Port.
Returns: none

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Procedure COUNTER_CLOSECOM; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Sub COUNTER_CLOSECOM Lib "CASH.DLL" ()

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Sub COUNTER_CLOSECOM Lib "CASH.DLL" ()



COUNTER_COUNT1
Parameter1: COUNT (1..65535) amount to count on counter 1
Parameter2: SPEED (1..65535) in ms. 50ms = 10 pulses/sec
Count on counter 1
Returns: 1, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function COUNTER_COUNT1(COUNT: Integer; SPEED: Integer): Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function COUNTER_COUNT1 Lib "CASH.DLL" (ByVal COUNT As Long, ByVal SPEED As Long) As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function COUNTER_COUNT1 Lib "CASH.DLL" (ByVal COUNT As Integer, ByVal SPEED As Integer) As Integer



COUNTER_COUNT2
Parameter1: COUNT (1..65535) amount to count on counter 2
Parameter2: SPEED (1..65535) in ms. 50ms = 10 pulses/sec
Count on counter 2
Returns: 1, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Function COUNTER_COUNT2(COUNT: Integer; SPEED: Integer): Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function COUNTER_COUNT2 Lib "CASH.DLL" (ByVal COUNT As Long, ByVal SPEED As Long) As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function COUNTER_COUNT2 Lib "CASH.DLL" (ByVal COUNT As Integer, ByVal SPEED As Integer) As Integer



COUNTER_CONNECTED
Parameter: none
Checks if a COUNTER-Board is connected
Returns: 0 = not connected, 1 = connected, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
function COUNTER_CONNECTED: Integer; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Function COUNTER_CONNECTED Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Function COUNTER_CONNECTED Lib "CASH.DLL" () As Integer



COUNTER_IN1
Parameter: none
Reads the status of input 1.
Returns: 0 = input 1 open, 1 = input 1 closed, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Procedure COUNTER_IN1; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Sub COUNTER_IN1 Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Sub COUNTER_IN1 Lib "CASH.DLL" () As Integer



COUNTER_IN2
Parameter: none
Reads the status of input 2.
Returns: 0 = input 2 open, 1 = input 2 closed, on error -1

Declaration in Delphi:
Simply add the DLL import unit 'cashdll' to your uses clause,
or add following line to the public declarations part:
Procedure COUNTER_IN2; stdcall; external 'cash.dll';

Declaration in Visual Basic 6:
Simply add the DLL import unit 'cashdll.bas' to your project,
or add following line to the declarations part:
Declare Sub COUNTER_IN2 Lib "CASH.DLL" () As Long

Declaration in Visual Basic .NET:
Simply add the DLL import unit 'cashdll.vb' to your project,
or add following line to the declarations part:
Declare Sub COUNTER_IN2 Lib "CASH.DLL" () As Integer



Tips to control the COUNTER

Parameter SPEED controls the speed of the counter and is declared in milliseconds, for example
50 means: 50ms HIGH + 50ms LOW signal = 100ms per count pulse, represents a frequency of 10Hz.

Time delay while opening the COM-Port

The COUNTER-Board has integrated a hardware time function which bridges the Windows interface test. On system boot the COM-Port is tested by the operating system and the lines go to HIGH for a short time. Without the time function the counters would begin to count while the interface test is active. Because of the time function there is a small delay of approx. 2 seconds opening the COM-Port. Therefore the COM-Port to the COUNTER-Board should be opened on program start so later the counters are ready without delay.



Other
- Since version 4.x we use the TOTALBLOCKING line to enable the devices!
- Since version 4.0.2 all variables are of the type INTEGER to be .NET compatible.
- Since version 4.0.3 the BUSY signal of the NVx is available (CASH_READ bit7).
- Since version 4.0.4 there is a new internal timer which reduces the time to load the DLL.
- Since version 4.0.5 all variables are of the type 32-Bit-integer
  (Delphi => INTEGER, Visual Basic 6 => LONG, Visual Basic .NET => INTEGER)
- Since version 4.0.6 functions for the seperately available HOPPER-Interface are integrated
- Since version 4.1.1.2 functions for the seperately available COUNTER-Board are integrated
- Since version 4.1.1.3 functions for the external inputs are integrated


Copyright © 2010 by bksoft