Ardac ote reader response time

Support for the Milan Intelligent interface, sold by Money Controls as the Paylink USB unit and for the earlier PCI card version.

Moderators: aardvark, davebush, Admin

Post Reply
jq
Posts: 19
Joined: Fri Jul 11, 2008 11:27 am

Ardac ote reader response time

Post by jq »

Hi all,
I have an Ardac (ID-003) note reader in my system. In order to move into a state where it will accept notes I use the following code:

Code: Select all

for (int i = 0; i < MAX_COINS; i++)
{//Loop through all the coins/notes
	if(this->globalConfig->coinStates.isInhibited[i] == false)
	{//check if this coin/note should be allowed
		for (int j = 0; j < MAX_NOTE_ACCEPTORS+MAX_COIN_ACCEPTORS; j++)
		{//Loop through acceptors
			if(this->m_Acceptors[j]->accepts(this->globalConfig->coinStates.coinValue[i]))
			{//find the correct acceptor for this note/coin and un-inhibit it
				this->m_Acceptors[j]->acceptCoin(this->globalConfig->coinStates.coinValue[i]);
			}
		}
	}
}
//Setup a timer
LARGE_INTEGER freq,start, end;
end.QuadPart=0;
QueryPerformanceFrequency(&freq);
QueryPerformanceCounter(&start);

while((this->m_MHE->doErrorChecks(true,ACCEPTOR) == MHE_ACPT_BUSY) && (((end.QuadPart-start.QuadPart) / freq.QuadPart) < 5))
{
	QueryPerformanceCounter(&end);
}
//wait for timeout or ACCEPTOR to no longer report itselft as busY
if(this->m_MHE->doErrorChecks(true,ACCEPTOR) == MHE_ACPT_BUSY)
{
	ASSERT(FALSE); //This never happens, so must not be reporting as busy
}



bool CBaseAcceptor::acceptCoin(int coinValue)
{

	if (!this->accepts(coinValue))
		return false;
	
	this->readBlock(); //update the local copy of the AcceptorDetailsBlock
	for(int i = 0; i<this->m_aBlock->NoOfCoins; i++)
	{// loop and find the correct index for this coin
		if (this->m_aBlock->Coin[i].Value == coinValue)
		{
			this->m_aBlock->Coin[i].Inhibit = 0;
			this->writeBlock();
			return true;
		}
	}
	return false;
}
A call to EnableInterface() has already been made before this code is run, as whilst waiting for a customer we need to poll the switch states.

The problem is (and this only happens on the note reader not the coin reader) that the note reader seems to take another 10 seconds after the code above has run to get into a state where it actually starts accepting notes.

Is there a quicker way to move the note reader from a state of not accepting anything to accepting notes from a list of values and vice cersa (timing is not as vital on the move from accept to reject though)?

I cannot use EnableInterface() as this has a blanket effect of enabling or disabling all interfaces including the one to the door switches which should always be on.

Failing that is there a way of getting the switch states without making a call to EnableInterface()?
davebush
Posts: 490
Joined: Fri Oct 22, 2004 12:20 pm

Post by davebush »

The first, simple, answer to your question is that you can set the ACCEPTOR_INHIBIT bit in the Status field. (This causes the ACCEPTOR_DISABLED bit to be set as feedback.)

Setting and clearing this bit has no affect on the list of coins, but stops / start the acceptor feeding notes.

Having said that, I know of no reason why there should be a 10 second delay when using your code - I would expect it to be almost instantaneous. Looking at the log (using MilanDiag) might show what is going on.

Finally, your code will run into problems if you have two coins / notes of the same value - something that is completely legal. I suggest you remove the return from inside the loop.
Aardvark software developer. Please put all communication on the problem through the board for the benefit of others.
Post Reply