Creating an Acceptor - PyramidTechnologies/netPyramid-RS-232 GitHub Wiki
Configuration and Usage
The primary class is called ApexValidator and it requires an RS232Configuration in order to instantiate.
Your configuration options:
Property | Required | Default | Description |
---|---|---|---|
CommPortName | true | String name of the comm port the acceptor is connected to | |
PollRate | false | 100 | Time in milliseconds between polls to the slave |
IsEscrowMode | false | false | If true, your client code will be asked to acceptor or return every note in escrow. If false, the note will be accepted as long as it is valid |
EscrowTimeoutSeconds | false | 0 | Time in seconds to hold a note in escrow before returning. This is only observed is IsEscrowMode is true |
EnableMask | false | 0x7F | Enable mask for denominations. Each bit (0b00000000) corresponds to a note index, 1-7. If the bit is 1, the note is enabled. 0 is disabled. |
With that in mind, creating a default acceptor is easy:
using Apex7000_BillValidator;
...
// Create a new instance using the specified port
RS232Config config = new RS232Config(PortName);
ApexValidator validator = new ApexValidator(config);
Connecting
Once you've created your acceptor, you may connect and the bill acceptor (if correctly configured) should enable and begin accepting notes)
// This starts the acceptor - REQUIRED!!
validator.Connect();
Now you're ready to configure some event handlers so you can be notified of credits, current state, and possible errors.