NCR realpos 70 User Manual page 131

Hide thumbs Also See for realpos 70:
Table of Contents

Advertisement

///////////////////////////////////////////////////////////////
void Terminate()
{
if ( m_bInitialized )
{
// Lock Mutex when accessing shared memory
WaitForSingleObject( g_hSharedMemoryMutex, INFINITE );
CloseHandle( m_hPowerMutex );
CloseHandle( g_hHWPortMutex );
// if the NT port driver was opened...
if (m_bPortDrvr )
{
// close the file handle
m_bPortDrvr = FALSE;
g_nPortDrvr=0;
CloseHandle(g_hPortDrvr);
g_hPortDrvr = NULL;
}
m_bInitialized = FALSE;
ReleaseMutex( g_hSharedMemoryMutex );
}
}
/////////////////////////////////////////////////////////
long OpenPort()
{
CString sData;
long RetStatus;
CString Result;
static TCHAR szIOPort[] = _T("Port");
// Get the IO H/W Configuration to set IOPORT addresses
// If other of same type exists then use same IOPort addresses
QueryConf(); // Sets IOPORT addresses based on H/W configuration
// initialize state
DWORD sBytes=0;
DWORD bMask = ~(CD7402DRWR1SOLENOID | CD7402DRWR2SOLENOID); // Set
Solenoid bits LOW
bMask = bMask | CD7402ARM_OFF; // set solenoid bits low and arm bit high
// **program solenoid bits as inputs to start
if ( !ReadIOPort(&sBytes, m_nIOPort_select) )
{
// Error logged in ReadIOPort
// TAR 95236
// Dec to zero using and close handle
Chapter 7: Cash Drawer Interface 7-13

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents