Activation of Paylink outputs

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
xagduran
Posts: 35
Joined: Sat Feb 15, 2020 3:15 pm

Activation of Paylink outputs

Post by xagduran »

Hello:
We are having a lot of trouble opening and closing the Paylink outputs, which open and close a relay.
This is what we use, it is programmed in C #:
int pulse = 0;
for (int i = 1; i <= numberPulses; i)
{
if (control == 0)
{
AESImhei.IndicatorOn (exit);
Thread.Sleep (pulse duration);
pulse ++;
}
else
{
AESImhei.IndicatorOff (exit);
Thread.Sleep (pulse duration);
control = 0;
}
}
You can tell us if the functions are correct.
What happens is that in our log, we see that all were sent, and sometimes not all arrive. If the outputs have to be activated 10 times, the value of numberPulses is 20, twice the number of times they have to be opened.
Can you guide us with this?
Thank you.
A greeting.
Angel
davebush
Posts: 482
Joined: Fri Oct 22, 2004 12:20 pm

Re: Activation of Paylink outputs

Post by davebush »

Hi,

In principle your code should work

1st - there appears to be a bug in the quoted code - you never set control non-zero.

2nd - Is pulse duration greater than 50 milliseconds? Paylink takes time to register changes in the state of on output.

3rd - are you aware that the parameter to IndicatorOn is the output number? (exit seems a strange variable name!)

Finally:
1/ Have you used the Demo program to check that you are correctly looking at the output?

2/ If your pulse requirements are "critical" then it would be worth you looking at Paylink's Hardware Meter facilities.
Aardvark software developer. Please put all communication on the problem through the board for the benefit of others.
xagduran
Posts: 35
Joined: Sat Feb 15, 2020 3:15 pm

Re: Activation of Paylink outputs

Post by xagduran »

Hello:
The code works correctly, what happens is that we have not sent it completely.
The problem that we see is that we register each pulse that is sent and that Paylink activates, and sometimes Palylink has sent, for example, 30, and the machine has received 22, and we do not know if it is because they are sent very fast, even by software , we have the possibility to change the shipping time, and sometimes they do not always arrive, the problem is that it does not always fail, it almost always sends them well, but sometimes it fails.
Thread.Sleep (pulse duration). With the pulse duration variable, we control the time it takes to send each pulse.
AESImhei.IndicatorOff (exit); the output variable indicates which output we want to activate, which in turn sends a signal to a relay terminal strip.
The variable pulse, when the pulses, and always send them well, but they do not reach the machine well.

Thank you.
A greeting.
Angel.
davebush
Posts: 482
Joined: Fri Oct 22, 2004 12:20 pm

Re: Activation of Paylink outputs

Post by davebush »

Hi,

If for some reason Windows doesn't schedule the Paylink driver for a period longer than your pulse time, it will never see it as having been set. This may be what is happening when you get a problem.

If you are trying to generate a precise number of pulses, then before you start your pulse timer you need to know that the output has actually changed. The easiest way to do this is to connect a spare Paylink output to a spare Paylink input so that you can check that the output changes have been processed. Your code then becomes something like:

if (control == 0)
{
AESImhei.IndicatorOn (exit);
AESImhei.IndicatorOn (MonitorOut);
while(AESImhei.SwitchCloses(MonitorIn) == AESImhei.SwitchOpens(MonitorIn))
{
Thread.Sleep (1);
}
Thread.Sleep (pulse duration);
pulse ++;
}

Alternatively, the hardware meter functionality guarantees a pulse train with at least 25 milliseconds high and at least 25 milliseconnds low.

Regards

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