Read/WriteInterface and rs232

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
ads_green
Posts: 1
Joined: Tue Apr 01, 2025 11:21 pm

Read/WriteInterface and rs232

Post by ads_green »

Hi all,

We’ve been using paylink devices for ages now (full v2 units in metal) but have an unusual scenario.

Is it possible to connect a random rs232 serial device (in this case it is a card dispenser) to one of the rs232 ports on the paylink and read/write serial data directly to and from the device?

I notice the ReadInterface/Writeinterface commands but looking through the .h header file the interface enum looks like it operates at a higher protocol level than the physical port on the paylink.

Thanks in advance.
davebush
Posts: 482
Joined: Fri Oct 22, 2004 12:20 pm

Re: Read/WriteInterface and rs232

Post by davebush »

Hi,

In general for RS232 you are better off using native Windows / Linux communications device handlers with a standard RS232 device.

If you still think that this is the best way to go, Paylink does have a special purpose RawPort interface for low level access to the Paylink ports - it was intended for non standard access to peripherals that were otherwise handled by Paylink - primarily downloading new note information.

This "documentation" for raw port is actually from the AESImnie.h file:

DoRawPort sends a command block to the raw port handler.
Note: These calls provide access to the very lowest level of the IMHEI hardware. The port number is a reference to the internal index of the serial communications hardware, and has no connection with Interface numbers.
Raw Channels are:
CCTALK_CHANNEL = 0,
RS232_CHANNEL = 1,
RJ45_CHANNEL = 2,
MDB_CHANNEL = 3
The results of that command then have to be retrieved by polling RawPortResult for a non-zero result.

All Raw port access *must* start with a RAW_CLAIM_PORT block, which will disable the normal port handler and end with a RAW_RELEASE_PORT which will re-instate the normal port handler.

A successful RAW_WRITE_DATA will be indicated by a return value of 1 to a subsequent RawPortResult call, after all the data has been transmitted.

A RAW_READ_DATA call will ignore the Length and Message, a subsequent call to RawPortResult will either return INTERFACE_NO_DATA or all the data that fas been read so far. (This will then be lost from the IMHEI)

enum {RAW_BLOCK_SIZE = 140} ;
typedef struct
{
int Function ;
int PortNumber ;
int Length ;
char Message[RAW_BLOCK_SIZE] ;
} RawPortStruct ;

enum { /* Values for Function */
RAW_CLAIM_PORT,
RAW_WRITE_DATA,
RAW_READ_DATA,
RAW_RELEASE_PORT,
RAW_RESET_IMHEI,


RAW_SET_9600_N_8,
RAW_SET_9600_E_8,
RAW_SET_9600_O_8,
RAW_SET_9600_N_9,
RAW_SET_19200_O_8,
RAW_SET_57600_O_8,
RAW_SET_38400_N_8
} ;

void DLL DoRawPort(RawPortStruct* Block) ;

int DLL RawPortResult(char Message[RAW_BLOCK_SIZE]) ;

RawPortResult returns the response to a single DoRawPort call.

Parameters
1. Message
If the DoRawPort function was RAW_READ_DATA, this is a pointer
to a RAW_BLOCK_SIZE byte block.

Return Values are as for ReadInterfaceBlock:

typedef enum {
INTERFACE_NO_DATA = -5, /* The handshake has completed, but no data was returned. */
INTERFACE_TOO_LONG = -4, /* Input command is too long */
INTERFACE_NON_EXIST = -3, /* Non command oriented interface */
INTERFACE_OVERFLOW = -2, /* Command buffer overflow */
INTERFACE_TIMEOUT = -1, /* Timeout on the interface - no response occurred */
INTERFACE_BUSY = 0 /* The response from the WriteInterfaceBlock has not */
/* yet been received */
} InterfaceStatus ;


Regards

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