EasyManua.ls Logo

NCR RealPOS 70 - Page 257

NCR RealPOS 70
306 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 12: Cash Drawer Interface 12-17
//////////////////////////////////////////////////////////////////////////////
// CDevice7402::SetState
BOOL SetState( DWORD dwState )
{
// Fire cashdrawer mechanism by setting drawer to the RELEASE State.
// Can't open both cash drawers at the same time. Must set H/W mutex
// in OpenDrawerLIO() around SetState(RELEASE) and SetState(IDLE) to
// insure this.
// To engage solenoid, we must set the solenoid bit HIGH and the ARM bit
// LOW. The ARM bit controls the external arming circuit to drive the
// solenoid.
CString sState;
DWORD bMask;
DWORD sBytes = 0;
DWORD oBytes = 0;
BOOL result = TRUE;
// Read select register
// Solenoid GPIO bits and ARM bit have been set to input when not using.
if ( ReadIOPort(&sBytes, m_nIOPort_select) )
{
// solenoid bits and ARM bit as outputs, Low enables output
sBytes = sBytes & CD7402SELECT_GPO;
result = WriteIOPort( sBytes, m_nIOPort_select );
}
else // Error logged in ReadIOPort
result = FALSE;
if(result)
{
switch( m_nDrawerNumber )
{
case 1:
// set solenoid bit high, arm bit low
bMask = CD7402DRWR1SOLENOID;
break;
case 2:
bMask = CD7402DRWR2SOLENOID;
break;
}
// Read solenoid bit
if ( ReadIOPort(&oBytes, m_nIOPort) )
{
switch (dwState)

Table of Contents

Related product manuals