PathSwitchLevel - not working from Java API

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
mzdunek
Posts: 25
Joined: Fri Apr 29, 2022 8:45 am

PathSwitchLevel - not working from Java API

Post by mzdunek »

Hello,

I am trying to set coin cassette as default path when U2 hopper is full (300 coins). Here is the code:

Code: Select all

AESImhei.AcceptorBlock TheAcceptor = new AESImhei.AcceptorBlock();
for (int A = 0; AESImhei.ReadAcceptorDetails(A, TheAcceptor); ++A) {
    for (int i = 0; i < TheAcceptor.NoOfCoins; ++i) {
        AcceptorCoin coin = TheAcceptor.Coin[i];
        coin.DefaultPath = 1;
        coin.PathSwitchLevel = 300;
    }
            
    TheAcceptor.Status = DISPENSER_REASSIGN_VALUE;
    AESImhei.WriteAcceptorDetails(A, TheAcceptor);
}
Unfortunately coins are still being directed to U2 hopper even after reaching count of 300.

What am I doing wrong?

Thanks,
Marcin
davebush
Posts: 482
Joined: Fri Oct 22, 2004 12:20 pm

Re: PathSwitchLevel - not working

Post by davebush »

Hi,

Before I start analyzing your code, have you read the section on routing on page 19 of the system manual: http://aardvark.eu.com/downloads/docume ... Manual.pdf

Dave
Aardvark software developer. Please put all communication on the problem through the board for the benefit of others.
mzdunek
Posts: 25
Joined: Fri Apr 29, 2022 8:45 am

Re: PathSwitchLevel - not working

Post by mzdunek »

Hello,

I have read the manual. I am aware of Path, DefaultPath and PathSwitchLevel.
davebush
Posts: 482
Joined: Fri Oct 22, 2004 12:20 pm

Re: PathSwitchLevel - not working

Post by davebush »

Hi,

It's not relevant, but this line is obviously wrong:
TheAcceptor.Status = DISPENSER_REASSIGN_VALUE;

You do not need to set Status at all, and especially not to a Dispenser value!

If you're programming in 'C' or 'C++' this line:
AcceptorCoin coin = TheAcceptor.Coin;
makes a local copy of the structure, so any modifications are just lost. (You need to make coin a pointer)

You can try out the values to see if they work, without getting into writing code by using the Demo program. The Demo program does very little apart from using WriteAcceptorDetails to update the Paylink.

Dave
Aardvark software developer. Please put all communication on the problem through the board for the benefit of others.
mzdunek
Posts: 25
Joined: Fri Apr 29, 2022 8:45 am

Re: PathSwitchLevel - not working

Post by mzdunek »

Sorry, I am using Java.
mzdunek
Posts: 25
Joined: Fri Apr 29, 2022 8:45 am

Re: PathSwitchLevel - not working

Post by mzdunek »

Can it be connected to issue when setting hopper as inhibit does not work? Here is the Java code:

Code: Select all

int Index = 0;
        AESImhei.DispenserBlock TheDispenser = new AESImhei.DispenserBlock();
        for (int D = 0; AESImhei.ReadDispenserDetails(D, TheDispenser); ++D) {
            if (TheDispenser.Value == value) {
                TheDispenser.Inhibit = inhibit ? 1 : 0;
                Index = D;
                break;
            }
        }
        if (TheDispenser.UnitAddress >= 3) {
            AESImhei.WriteDispenserDetails(Index, TheDispenser);
        }
My goal is to disable specific hopper from payout.
davebush
Posts: 482
Joined: Fri Oct 22, 2004 12:20 pm

Re: PathSwitchLevel - not working

Post by davebush »

Hi,

I can see nothing obviously wrong with you code snippets.

My best suggestion is that you run “MilanDiag” to observe the Paylink log being written and then run the "Demo" program to control Paylink

The Acceptor details and Dispenser details screens mirror quite closely the fields in AcceptorBlock and DispenserBlock, and the Demo program issues WriteAcceptorDetails() / WriteDispenserDetails() calls every time you update fields on the screen.

You should see the results of these updates being actioned, and Paylink deciding what to do with inserted coins, on the log. Some of the messages may be obscure but many of them should be perfectly understandable. This should then give you a reference log of Paylink working properly.

Once you’ve done that you should then be able to compare the logged results of executing your code against this reference

Regards

Dave
Aardvark software developer. Please put all communication on the problem through the board for the benefit of others.
Post Reply